Forum Discussion

DKNP's avatar
DKNP
Occasional Contributor
8 years ago

Excel - UpdateLinks := causing syntax error

Hi

 

Possible silly question time.

 

I have several spreadsheets which contain links to cells in other spreadsheets. I need these links to be updated while a test is running, however whenever i open the workbook using the following i get a syntax error at the :=

 

Dim objWorkBook   Set objWorkBook = objExcel.Workbooks.Open(strWorkBookName, Updatelinks:=True)

 

I have tried replacing the := with just = and while the syntax error is resolved it doesn't update the link...

 

Does anyone have a working solution to get around the := causing a syntax problem.

 

Many thanks

2 Replies

  • shankar_r's avatar
    shankar_r
    Community Hero

    Let me understand your question,

     

    For Ex: You are having a Workbook with 2 sheets.

     

    A1 cell of in Sheet1 having value of "Test"

    You are linking A1 cell of Sheet1 in A2 cell of Sheet2 as below,

     

    Then you will see the Link in A1 cell in Sheet2 as below,

     

    I guess, You are expecting "Test" text in the A2 cell of Sheet2 thru TC script.

     

    For this you are using UpdateLinks Correct?

     

  • From a dim and distant memory, I'm sure there is an option setting somewhere in Excel which determines whether it tries to automatically update things like this when you open a sheet?

     

    I'm wondering if that may be part of the problem. If you set it to ignore notifications before opening the file, does this still happen?

     

    *EDIT*

     

    Update. Sorry. I just re-read it. I think it's that setting you're trying to trigger on opening the sheet.

     

    I've never tried to do this. Is it a setting (such as visibility and notifications) that you set before opening the sheet?