LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Embedding Existing Excel chart into VB6 form

Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
xl.displayalerts = False
wbk.save
wbk.Close
Set xl = Nothing
End Sub


You'll find this more efficient...

Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
xl.wbk.Close False '//no changes so don't save
xl.Quit: Set wbk = Nothing: Set xl = Nothing
End Sub

...because it cleans up VB6 properly AND doesn't leave Excel running with
DisplayAlerts turned off! (Closing a workbook and specifying the SaveChanges
arg effectively cancels the "Do you want to save..." alert!)

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
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
Embedding a pie chart from excel Dig Charts and Charting in Excel 1 December 9th 07 05:26 AM
Embedding an annotation or a comment to a chart in Excel 2007 Refresher Charts and Charting in Excel 5 August 13th 07 08:01 PM
Embedding spreadsheet in a user form GeorgeJ Excel Discussion (Misc queries) 3 July 24th 07 07:20 PM
Can I scan an existing paper form into excel accounting Excel Discussion (Misc queries) 3 January 25th 07 06:13 PM
Embedding excel charts in my C# windows form Matt Kosorok Charts and Charting in Excel 0 May 11th 05 05:02 PM


All times are GMT +1. The time now is 02:48 PM.

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"