Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running a VB Script
Hello.
I am trying to run the following script, which runs a macro, and it works perfectly except for one detail. The purpose of the macro is to modify the excel file (it contains data for labels), save it and call an .exe which prints the labels. Every time I run the script, after it is done, a 'File Available for Use' window pops up telling me that my excel file is available for editing giving me the option to open it as 'read/write' or 'cancel'. Even if I hit cancel, it still tries to open the file. It's doing this everytime. Is there a way to shut this off? Other than this, I've run the script multiple times and works just fine. -Sofia |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running a VB Script
Sounds like you might be trying to open the file twice.
Regards, Tom Ogilvy "Sofia Katchi" wrote in message ... Hello. I am trying to run the following script, which runs a macro, and it works perfectly except for one detail. The purpose of the macro is to modify the excel file (it contains data for labels), save it and call an .exe which prints the labels. Every time I run the script, after it is done, a 'File Available for Use' window pops up telling me that my excel file is available for editing giving me the option to open it as 'read/write' or 'cancel'. Even if I hit cancel, it still tries to open the file. It's doing this everytime. Is there a way to shut this off? Other than this, I've run the script multiple times and works just fine. -Sofia |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running a VB Script
I thought so too but I checked my code and the script opens the excel
file, runs the macro (which does not try to open it again), and saves and closes the excel file. Here's the script: Dim XL Dim WB Set XL = CreateObject("Excel.Application") Set WB = XL.Workbooks.Open ("C:\2dseismiclabels.xls") msgbox("about to print labels") xl.Run "Macro1" msgbox("finished printing labels") wb.save WB.Close XL.Quit Set WB = Nothing Set XL = Nothing *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VB Script | Excel Worksheet Functions | |||
question about some excel restriction script running on ... | Excel Discussion (Misc queries) | |||
question about some excel restriction script running on ... | Excel Discussion (Misc queries) | |||
Running a script while editing a cell | Excel Discussion (Misc queries) | |||
when i save xls file, debug script is running and canno't save fil | Excel Discussion (Misc queries) |