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: 3
Default VB and I can't close the excel file

hi,
in the following, there is a simple excel file open, write and close code.
It works in my desktop computer very well, I mean it opens the file, writes
something and close the file.

but in my laptop, it doesn't close. It continues to appear in the task
manager, in every time when I used the program, I have to close it in task
manager or it will increase as I used the program mean there is
5,6,7...excel.exe program in the task manager.

what should I do ?
thank you.

Dim XLSapp As Excel.Application
Dim XLSbook As Excel.Workbook
Dim XLSsheet As Object

Private Sub Command1_Click()
Set XLSapp = New Excel.Application
Set XLSbook = XLSapp.Workbooks.Open("c:/test.xls")
Set XLSsheet = XLSbook.Worksheets(1).Cells

XLSsheet(4, 4) = "abc"

Set XLSsheet = Nothing
XLSbook.Close savechanges:=True
Set XLSbook = Nothing
XLSapp.Quit
Set XLSapp = Nothing

End Sub

 
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
Everytime i close an excel file, it creates a new backup file p Excel Discussion (Misc queries) 3 November 22nd 07 08:13 AM
Have Excel file close itself Jason Lepack Excel Programming 0 January 12th 07 05:28 PM
Close a File and Excel ?? rvillanueva[_5_] Excel Programming 6 May 1st 06 05:42 AM
File close excel does not ask me to save changes Cathy Humphreys Excel Discussion (Misc queries) 2 June 13th 05 08:48 PM
How to Close the entire Excel File Duraiswamy Lingappan Excel Programming 1 July 16th 04 11:12 AM


All times are GMT +1. The time now is 03:50 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"