+ Reply to Thread
Results 1 to 3 of 3

Need help with a link to another workbook

  1. #1
    Forum Contributor
    Join Date
    07-07-2005
    Location
    England
    MS-Off Ver
    Office 2019 Enterprise
    Posts
    473

    Need help with a link to another workbook

    Hi,

    I am having massive problems with the following and was hoping someone could help me out!!

    I am trying to show the value in a cell on another workbook in a MsgBox.

    In Excel, the cell formula is:
    ='\\128.128.128.5\Data\DATA\FUEL\[FUELCARD.xls]FUEL CARDS'!$D$272

    This shows whatever value is in cell D272 in the FUELCARD.xls spreadsheet in the DATA folder on the 128.128.128.5 machine.

    When I try to get this as a message box I use the following code..

    MsgBox _
    ('\\128.128.128.5\Data\DATA\FUEL\[FUELCARD.xls]FUEL CARDS'!R272C4))

    And I'm given the error:

    Compile Error: Expected Expression

    and then it highlights the '

    Can someone tell me what I am doing wrong please?

    Thanks

    John

  2. #2
    Registered User
    Join Date
    10-18-2006
    Posts
    49
    could be related to the path, some missing letter or something like that.
    Try this:
    - open the file where the subject cell (where you want to enter the formula) is
    - type "="
    - then open the network file and select the respective cell and press enter

  3. #3
    Forum Contributor
    Join Date
    07-07-2005
    Location
    England
    MS-Off Ver
    Office 2019 Enterprise
    Posts
    473
    Many thanks for your reply, however there is no problem with the reference for the link.

    This is really starting to bug me!!

    To test yourself (really appreciate if you could try this):

    Make a new workbook on your C Drive C:\JohnCassell1.xls
    Then make another one C:\JohnCassell2.xls

    In Cell A1 of the JohnCassell2 workbook enter 99.

    Then in cell A1 of JohnCassell1 type "=" then click on cell A1 of the other workbook.

    Close that workbook.

    The formula looks like this: ='C:\[JohnCassell2.xls]Sheet1'!$A$1

    and shows a value of 99.

    Then in VB Editor try and make a MsgBox which shows the value of the cell in the closed workbook. This is my attempt...

    MsgBox C:\[JohnCassell2.xls]Sheet1'!$A$1.value

    This is what I cannot do.

    Just comes back with errors.

    Any help at all would be really appreciated.

    Once again, thanks for your reply.

    John

+ Reply to Thread

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