J
Janis
Could this be a problem with using open on a sharepoint site or do I have
something wrong with an object? Since it is a run-time error it doesn't tell
me exactly what to look for .
thanks,
Option Explicit
Private reportTitle, filePath, reportDate As String
'Copies Excel spreadsheet from http://vsps02/sites/default.aspx/Capacity
Managmenet/Weekly Report/
Sub CopySheet()
Dim sharePointURL As String
Dim objExcel, objWorkbook, objWorksheet As Object
sharePointURL = "http://vsps02/sites/default.aspx"
reportTitle = "Capacity Report"
reportDate = "07-0630"
filePath = "c:\\Temp\Segmentation"
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(filePath & reportDate & " " &
reportTitle)
objExcel.Visible = True
Set objWorksheet = objWorkbook.Worksheets("Port History")
objWorksheet.Copy
ActiveWorkbook.SaveAs Filename:=filePath & reportDate & " " & reportTitle
'ActiveWorkbook.Close
End Sub
something wrong with an object? Since it is a run-time error it doesn't tell
me exactly what to look for .
thanks,
Option Explicit
Private reportTitle, filePath, reportDate As String
'Copies Excel spreadsheet from http://vsps02/sites/default.aspx/Capacity
Managmenet/Weekly Report/
Sub CopySheet()
Dim sharePointURL As String
Dim objExcel, objWorkbook, objWorksheet As Object
sharePointURL = "http://vsps02/sites/default.aspx"
reportTitle = "Capacity Report"
reportDate = "07-0630"
filePath = "c:\\Temp\Segmentation"
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(filePath & reportDate & " " &
reportTitle)
objExcel.Visible = True
Set objWorksheet = objWorkbook.Worksheets("Port History")
objWorksheet.Copy
ActiveWorkbook.SaveAs Filename:=filePath & reportDate & " " & reportTitle
'ActiveWorkbook.Close
End Sub