Jump to content

ExcelCOM AskToUpdateLinks - set to no


Recommended Posts

I understand that

$oExcel.AskToUpdateLinks = false

will automatically select yes and update the links. However, I want it to automatically select no, thus not updating the links. Does any one know a way to do this through COM and not through click the no button?

Where I'm pulling my info

http://msdn2.microsoft.com/en-us/library/bb220846.aspx

A decision is a powerful thing
Link to comment
Share on other sites

I understand that

$oExcel.AskToUpdateLinks = false

will automatically select yes and update the links. However, I want it to automatically select no, thus not updating the links. Does any one know a way to do this through COM and not through click the no button?

Where I'm pulling my info

http://msdn2.microsoft.com/en-us/library/bb220846.aspx

try setting AskToUpdateLinks to True and $oExcel.DisplayAlerts to False
Link to comment
Share on other sites

nope that doesn't work

thanks though!

btw, as you can see this COM method has enlightened me :whistle: Thank you SO much for that tip!!

always glad to help, i'll look into it a little bit more and see if we can't get this working.... do you have a sample spreadsheet to use for testing?
Link to comment
Share on other sites

Here are the example files

test

test2

test.xls updates from test2.xls

There are no macros just the formula for updating. I'm working on figuring this out to. It is important that I figure it out besides the fact that I'm curious.

i'm going to start playing with it now, but i only have about 30 minutes until lunch. i'll try to figure something out before i go.
Link to comment
Share on other sites

The reason DisplayAlerts won't work for accomplishing this task (I believe) is as follows:

"The default value is True. Set this property to False if you dont want to be disturbed by prompts and alert messages while a macro is running; any time a message requires a response, Microsoft Excel chooses the default response."

-http://msdn2.microsoft.com/en-us/library/bb177478.aspx

A decision is a powerful thing
Link to comment
Share on other sites

The reason DisplayAlerts won't work for accomplishing this task (I believe) is as follows:

"The default value is True. Set this property to False if you dont want to be disturbed by prompts and alert messages while a macro is running; any time a message requires a response, Microsoft Excel chooses the default response."

-http://msdn2.microsoft.com/en-us/library/bb177478.aspx

i was working on breaking the link before opening, but was getting prompted anyway, even with display alerts off. so i looked into it a little, and remembered something....

with workbooks.open() the second parameter is the update links parameter, so something like this would do what you want....

$oex = ObjCreate("excel.Application")
$mywb = $oex.workbooks.Open("u:\test.xls",False)

would open and not link.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...