Results 1 to 10 of 10

Thread: XL - Updating Links on open *Resolved*

  1. #1

    Thread Starter
    Hyperactive Member Granty's Avatar
    Join Date
    Mar 2001
    Location
    London
    Posts
    439

    XL - Updating Links on open *Resolved*

    Hi all,

    I programmatically open up an Excel File and do some stuff with it. This is all good.

    However it has links in it, so I get that annoying message asking me whether I want to update them when I open the workbook. Is there anyway to stop this message or automatically tell it 'no'?

    Thanks
    J.
    Last edited by Granty; Mar 26th, 2003 at 03:50 AM.

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Hi,

    You'll want to be looking at the Excel.Application.Displayalerts call to sort this one!

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    Hyperactive Member Granty's Avatar
    Join Date
    Mar 2001
    Location
    London
    Posts
    439
    Thanks for replying Alex.

    But I actually use the displayalerts all the time, but it does not seem to get rid of this message. Every other one yes, but this one no

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    ahh weird, have you tried calling this one beforehand:

    Application.Workbooks(1).UpdateLinks xlUpdateLinksNever

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5

    Thread Starter
    Hyperactive Member Granty's Avatar
    Join Date
    Mar 2001
    Location
    London
    Posts
    439
    Hmmm....

    I get a compile error on that one - doesn't recognise 'xlUpdateLinksNever'

    Actually I dont even have 'updatelinks', just the singular 'updatelink' which wants a link name parameter etc.

    I am using Access 97 here, referencing the Excel 8.0 library. Will that make the difference?

  6. #6

    Thread Starter
    Hyperactive Member Granty's Avatar
    Join Date
    Mar 2001
    Location
    London
    Posts
    439
    Ahhhh...checking on MSDN I am guessing this is an Office XP thing.

    Bugger.

  7. #7
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Drat, yeah just checked that out myself - it looks to be XP only - back to the drawing board!

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  8. #8

    Thread Starter
    Hyperactive Member Granty's Avatar
    Join Date
    Mar 2001
    Location
    London
    Posts
    439
    OK, we have Application.AsktoUpdateLinks = False....

    But....

    This then counts as pressing 'Yes' so does the whole updating thing

    Close but no cigar

  9. #9
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Heh I'm at home now using Excel 2000 & have the 97 help files with me now rather than XP - I just found the same one you did: Excel.Application.AskToUpdateLinks = False, but then spotted this explanation from MSDN:
    "True if Microsoft Excel asks the user to update links when opening files with links. False if links are automatically updated with no dialog box. Read/write Boolean."
    You're right this one is no good whatsoever, but.... I did find that there is a parameter you can set on the workbook open method:

    Excel.Application.workbooks.Open _
    Filename:="C:\Path\file.xls", Updatelinks:=false

    I programmatically open up an Excel File and do some stuff with it. This is all good.
    Since you're opening the file through code, you should be able to set this parameter & solve youur problem...

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  10. #10

    Thread Starter
    Hyperactive Member Granty's Avatar
    Join Date
    Mar 2001
    Location
    London
    Posts
    439
    Superstar!

    Thanks for all your help mate.

Posting Permissions

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



Click Here to Expand Forum to Full Width