Close excel files in VB applications 
Author Message
 Close excel files in VB applications

Hi,
In the vb application I am working on, an excel file
(*.xls) is opened. However, I have to quit the file before
I close the application, or the excel file stays in
background.

How can I quit the excel files while I click on the close
button, the X on the top-right corner.

Thanks
Liu



Tue, 21 Sep 2004 01:33:38 GMT  
 Close excel files in VB applications
If you need to close file - use Close method of Workbook object.
If you need to "close" excel at all - use Quit method of Application Object

Mikhail Berlyant
Data Integrator, Yahoo!Music   www.yahoo.com
Brainbench MVP for Visual Basic   www.brainbench.com


Quote:
> Hi,
> In the vb application I am working on, an excel file
> (*.xls) is opened. However, I have to quit the file before
> I close the application, or the excel file stays in
> background.

> How can I quit the excel files while I click on the close
> button, the X on the top-right corner.

> Thanks
> Liu



Tue, 21 Sep 2004 01:50:00 GMT  
 Close excel files in VB applications
I know that, but how to put the quit method in the close
button, the X button on th top-right cornver? Something
like:

Private Sub Command1_Click()
   excelapp.quit
end sub

Thanks

Quote:
>-----Original Message-----
>If you need to close file - use Close method of Workbook
object.
>If you need to "close" excel at all - use Quit method of
Application Object

>Mikhail Berlyant
>Data Integrator, Yahoo!Music   www.yahoo.com
>Brainbench MVP for Visual Basic   www.brainbench.com



Tue, 21 Sep 2004 02:00:24 GMT  
 Close excel files in VB applications
Private Sub Form_Unload(Cancel As Integer)
    excelapp.quit
End Sub

Mikhail Berlyant
Data Integrator, Yahoo!Music   www.yahoo.com
Brainbench MVP for Visual Basic   www.brainbench.com


Quote:
> I know that, but how to put the quit method in the close
> button, the X button on th top-right cornver? Something
> like:

> Private Sub Command1_Click()
>    excelapp.quit
> end sub

> Thanks

> >-----Original Message-----
> >If you need to close file - use Close method of Workbook
> object.
> >If you need to "close" excel at all - use Quit method of
> Application Object

> >Mikhail Berlyant
> >Data Integrator, Yahoo!Music   www.yahoo.com
> >Brainbench MVP for Visual Basic   www.brainbench.com



Tue, 21 Sep 2004 02:07:49 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. need help: Open Excel, run macro, save file, close Excel

2. saving and closing opened excel file in VB

3. How to close an excel or word file which is opened in another application and also close the application

4. Accessing VBIDE.VBE.VBProjects via Excel in VB .NET Causes Excel To Crash When Closed

5. applications closed by my vb-application.

6. Open Excel File (Excel.Application)

7. Writing Excel Files W/O Existing Excel Application

8. Detecting EOF for Excel file using Excel Application Object

9. Closing an Excel Application Object in VB6.

10. Close and Save Open Excel File

11. a macro to export tasks to a excel file at close

12. Copy a closed Excel File

 

 
Powered by phpBB® Forum Software