Closing a workbook using VBA programatically (1 Viewer)

fulltime

Registered User.
Local time
Today, 09:20
Joined
Mar 24, 2006
Messages
56
I am using VBA to open an excel spreadsheet with the comand below,

Set objBook = objExcel.Workbooks.Open(tbFile)

to close the workbook, i use

objExcel.Workbooks.Close

however, if i have 3 active windows for MS excel, it will close all 3 windows after the statement above. I onli wan MS excel to close onli the "tbFile" tat i opened. how can tat be done?

thks

FT :)
 

fulltime

Registered User.
Local time
Today, 09:20
Joined
Mar 24, 2006
Messages
56
Sergeant said:
Did you try objBook.Close ???

thks, i found the solution.. to close onli the active work book, use activeworkbook.close..


thks
 

Users who are viewing this thread

Top Bottom