LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Application.quit is causing my macro to run and print twice...

I've been displaying an Excel report in a browser window
via Java's getAppletContext().showDocument(url,"_blank")
with no problems. I then tried to do the same for
printing only after formatting I wanted to use the
following statements to print and exit out of Excel. The
problem is the application.quit is causing the macro to
run twice and give me two print outs. When I remove the
application.quit I get one print out but the browser
window stays open with my Excel report visible. Anyone
have any ideas as to why it's executing twice?

My code in Auto_Open is as follows:

Application.Visible = False
Application.WindowState = xlMinimized
Application.DisplayAlerts = False
Application.DefaultWebOptions.DownloadComponents =
False
Main <--- formats report
ActiveWorkbook.Saved = False
ActiveSheet.PrintOut
Application.Quit

 
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
Can't get the macro to quit Carrie_Loos via OfficeKB.com Excel Discussion (Misc queries) 6 May 14th 08 11:25 PM
Macro to quit application K11ngy Excel Discussion (Misc queries) 7 July 6th 07 04:48 PM
Excel application.quit in macro problem TimkenSteve New Users to Excel 3 August 17th 06 06:36 PM
Macro to paste and print in another application punter Excel Discussion (Misc queries) 1 June 17th 06 04:40 PM
Quit Application Robert Black Excel Programming 1 July 31st 03 04:15 PM


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

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

About Us

"It's about Microsoft Excel"