Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB Script Krista Excel Worksheet Functions 4 May 20th 06 03:12 PM
question about some excel restriction script running on ... roise_r Excel Discussion (Misc queries) 0 March 30th 06 11:53 AM
question about some excel restriction script running on ... roise_r Excel Discussion (Misc queries) 0 March 30th 06 11:44 AM
Running a script while editing a cell clayton Excel Discussion (Misc queries) 8 December 15th 05 10:24 PM
when i save xls file, debug script is running and canno't save fil Imtiaz Excel Discussion (Misc queries) 1 July 16th 05 03:47 PM


All times are GMT +1. The time now is 07:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"