Results 1 to 5 of 5

Run-time error 438 - when controlling Excel remotely

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Run-time error 438 - when controlling Excel remotely

    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
    Last edited by longbow007; 08-13-2009 at 08:35 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1