+ Reply to Thread
Results 1 to 4 of 4

Thread: ExecuteExcel4Macro

  1. #1
    Registered User
    Join Date
    02-16-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    78

    ExecuteExcel4Macro

    Hi,

    I am trying to read some values from a closed workbook.

    I use the following code

    Dim Data As String
        
        On Error GoTo label:
        'Data = "'" & Path & "[" & File & "]" & Sheet & "'!" & "$A$4"
        Data = """" & "'" & Path & "[" & File & "]" & Sheet & "'!" & Range("$A$4").Range("A1").Address(, , xlR1C1) & """"
    
        GetData = ExecuteExcel4Macro(Data)
    label:
        MsgBox Err.Number & Err.Description
    But GetData always have this value 'C:\Program Files (x86)\Microsoft Office\Office12\LIBRARY[Upload.xla]Hidden'!R4C1

    instead of getting the value from the address R4C1 in hidden sheet in Upload addin , it always has the as path to address which is "'C:\Program Files (x86)\Microsoft Office\Office12\LIBRARY[CostUpload.xla]Hidden'!R4C1"

    Can u anyone tell me where I am going wrong??
    Last edited by Ranjani; 05-04-2009 at 05:11 PM.

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: ExecuteExcel4Macro

    As a minimum, you're missing the backslash after LIBRARY in the path.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    02-16-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: ExecuteExcel4Macro

    Hi SHg,

    I did try that , i changed data to "'C:\Program Files (x86)\Microsoft Office\Office12\LIBRARY\[CostUpload.xla]Hidden'!R4C1"

    and GetData still holds the value 'C:\Program Files (x86)\Microsoft Office\Office12\LIBRARY\[CostUpload.xla]Hidden'!R4C1.

    Thanks

  4. #4
    Registered User
    Join Date
    02-16-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: ExecuteExcel4Macro

    Hi Shg,

    I removed the enclosing string in
    Data = "'C:\Program Files (x86)\Microsoft Office\Office12\LIBRARY\[CostUpload.xla]Hidden'!R4C1"
    to
    Data = 'C:\Program Files (x86)\Microsoft Office\Office12\LIBRARY\[CostUpload.xla]Hidden'!R4C1
    and it worked !!

    Thanks Shg,

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0