snaileater Posted May 18, 2008 Posted May 18, 2008 Hi,i would like to open an Excel file containing external links. In this case u got a popup window asking if u want to update or not the links contained.Is there any way to open this file with autoit by providing an automatic or default answer to the "update links" question ?Thanks !
snaileater Posted May 19, 2008 Author Posted May 19, 2008 nobody ? ... could anyone help me get rid of this popup window ? ;-(
zackrspv Posted May 19, 2008 Posted May 19, 2008 Hi,i would like to open an Excel file containing external links. In this case u got a popup window asking if u want to update or not the links contained.Is there any way to open this file with autoit by providing an automatic or default answer to the "update links" question ?Thanks !Use the Autoit Info tool to find out the name of that window/class of that window and the control for the 'yes' (if there is one) button. And then just use controlclick or controlsend (depending on what you need) to actually click the button for you.That would be my guess -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë ë§§ëñ§ë øƒ !ïƒë.
snaileater Posted May 19, 2008 Author Posted May 19, 2008 Use the Autoit Info tool to find out the name of that window/class of that window and the control for the 'yes' (if there is one) button. And then just use controlclick or controlsend (depending on what you need) to actually click the button for you.That would be my guess Yeah but how ? in two different processes ? one opening the file and a second checking the popup window ? ... doesn't look very reliable ... thanks for helping anyway.
zackrspv Posted May 19, 2008 Posted May 19, 2008 Yeah but how ? in two different processes ? one opening the file and a second checking the popup window ? ... doesn't look very reliable ... thanks for helping anyway.No.Lookup these functions in the Help File:1. ShellExecute2. WinActive, WinExists, WinWait, WinWaitClose, WinWaitNotActive, 3. ControlSend4. ControlClickOne autoit script can launch excel; wait until the program is active, wait until a specified window is active, and then send a click to that control's 'yes' button. Personally, I don't use Excel, so I can't test this out for you I'm an OpenOffice guy But, you don't need 2 separate processes -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë ë§§ëñ§ë øƒ !ïƒë.
someone Posted May 19, 2008 Posted May 19, 2008 Did some googling check this out... Click meSeems like you maybe able to trap the error with $oExcel.Application.EnableEvents = False ... can't test it though. Also you may have more luck posting in the excel UDF topic in the example forum. Only if you can't get anywhere here that is.Let us know how that works out While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
snaileater Posted May 21, 2008 Author Posted May 21, 2008 i have just written a "test-popup.exe" ... ran by my main script just before opening the Excel File ... test-popup.exe contains a WinWaitActive waitin for the "update link" popup and sendin an automatic Yes or No to the question ... I don't find the solution very clean ... but it works so far ...
someone Posted May 22, 2008 Posted May 22, 2008 Adlib should work but out of curiosity did you try the method in the link? While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
snaileater Posted May 23, 2008 Author Posted May 23, 2008 i don't understand ... when i sometimes try to open this Excel File with $oExcel = _ExcelBookOpen("C:\example.xls") i have a popup "update link" window and sometimes when tried on an other computer ... it doesnt popup ... weird ... I haven't tried adlib so far ...
snaileater Posted May 23, 2008 Author Posted May 23, 2008 how can the direct opening of an excel file in the file manager generate this "update links" popup ... which doesn't appear when opened by my autoit script (which is good but not understandable for me ... and doesnt always behave this way ...) do u know ?
someone Posted May 23, 2008 Posted May 23, 2008 (edited) Well...I wish I had started off at msdn, as the answer was a simple as adding a 0. I didn't try incorporating this into the Excel UDF, but I'm sure you can if you feel like editing it.$sFilePath = @DesktopDir & "\test.xls" $oExcel = ObjCreate("Excel.Application") With $oExcel .Visible = 1 .WorkBooks.Open($sFilePath, 0) EndWithLook at the msdn link to learn more about it.EDIT: a little unclear... Edited May 23, 2008 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
snaileater Posted May 24, 2008 Author Posted May 24, 2008 well ... RTFM is always a good advice ... ;-) My mistake was that i used the excelcom UDF _ExcelBookOpen command that (i think) doesn't contain this parameter. But when tryin the basic COM workbook OPEN command it works as expected ... Thanks for ur help !
PhilPrescott Posted July 29, 2009 Posted July 29, 2009 $sFilePath = @DesktopDir & "\test.xls" $oExcel = ObjCreate("Excel.Application") With $oExcel .Visible = 1 .WorkBooks.Open($sFilePath, 0) EndWith This opens the file as read only. If you want to update the links it won't work. You can set the excel file to open and automatically update links under Edit>Links from the toolbar.
Juvigy Posted July 30, 2009 Posted July 30, 2009 You are not right - The open method have it all :Parameters:UpdateLinks Optional Variant Specifies the way links in the file are updated. If this argument is omitted, the user is prompted to specify how links will be updated. For more information on the values used by this parameter, see the Remarks section. If Microsoft Excel is opening a file in the WKS, WK1, or WK3 format and the UpdateLinks argument is 2, Microsoft Excel generates charts from the graphs attached to the file. If the argument is 0, no charts are created.ReadOnly Optional Variant True to open the workbook in read-only mode.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now