hello, could some one please look at my code and advise on how to fix my excel 2003 run-time error 438 "Object doesn't support this property or method" error? The VBE highlights this line of code:
Set xlDoc = xlApp.Documents.Open("G:\JOC\HQJOC\J1-4 Support\J1 NWCC\Databases\Finance\NWCC Financial Register - Charts.xls")
The code below is the entire macro:
Sub OpenExcelWorkbook()
'In order to use this code you must set a reference to the
'Word object library by doing this. In the VB Editor click
'Tools, References. Then search for Microsoft Excel n.n Object Library
'where n.n will depend on your version of Excel.
Dim xlApp As Excel.Application, xlDoc As Excel.Workbook
On Error Resume Next
Application.ScreenUpdating = False
On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")
If Err.Number <> 0 Then 'Excel isn't already running
Set xlApp = CreateObject("Excel.Application")
End If
On Error GoTo 0
Set xlDoc = xlApp.Documents.Open("G:\JOC\HQJOC\J1-4 Support\J1 NWCC\Databases\Finance\NWCC Financial Register - Charts.xls")
xlApp.Visible = True
xlDoc.Activate
End Sub
Any help on this would be greatly appreciated.
Kind regards,
Chris
Bookmarks