Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 00:09

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Autoit - Closing Excel workbooks.......

Discussion on Autoit - Closing Excel workbooks....... within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2017
Posts: 1
Received Thanks: 0
Autoit - Closing Excel workbooks.......

Hello folks,

I have a random 5 excel files named Workbook, Workbook2..... Workbook5 linked to a program. I wish to arrange all of them side by side for comparison. I do this by using shortcut Alt-W-A-V-Enter through Autoit. [ Figure ]

I wish to close each of the Workbooks WITHOUT saving, using Autoit. I tried to use the following code:

/////////////


/////////////

However, I see that the Windows on the Taskbar are closed, but the actual Workbooks are still present in the desktop and are not closed [ Figure ] .

I tried using both ProcessClose and WinKill [as in the final lines of the above code - by removing the semi-colons one line at a time]. Using ProcessClose, the Excel program does indeed close, BUT, it does not close 'graciously', that is, when Excel is reopened, the files are prompted for recovery [ on the left side of Figure ] . Using WinKill too, the Excel program gets closed, but it appears to be Crashing. The program linked to these files (mentioned on the very first line of this post) also crashes due to this excel crash, and stops working.

How do I close each workbook smoothly without saving them? I can press 'n' when prompted for saving.

I have not used the Excel.au3 function yet. (I looked it a little, but unable to deduce anything with my available short time.) Would the above code need it? If so, can you help by using the appropriate calls like _Excel_BookClose or _Excel_Close in the above code?

Thanks for your time.

-Dave

Never mind, solved at .

Thanks.
hutralospi is offline  
Old 07/05/2017, 15:10   #2

 
merquart's Avatar
 
elite*gold: 110
The Black Market: 328/0/0
Join Date: Jul 2011
Posts: 4,588
Received Thanks: 626
I know u solved it, but u could use the Excel.au3 and use
merquart is offline  
Reply


Similar Threads Similar Threads
autoit excel nach über halbem jahr nutzung plötzlich error meldung? hilfe!!!!
03/13/2017 - AutoIt - 1 Replies
Hallo Forum, ich habe vor ca einem halben jahr ein datendigitalisierungsprogram geschrieben über des ich akten einfach digitalisieren kann. es überträgt die daten die ich in die gui eintrage dann in excel und speichert die datei. zuletzt habe ich das prog am freitag verwendet ohne probleme. heute dann starte ich es und beim speichern der datei sagt autoit mir folgenen fehler. Excel UDF: Excel_RangeWrite Error writing to worksheet. @error= 3, @ extended= -2147352567



All times are GMT +1. The time now is 00:11.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.