to close a workbook via VBA

J

J_J

I need to know the code to close a workbook which was opened on XL2003 with
the code line below

Workbooks.Open(strFileName1, Editable:=True).RunAutoMacros
Which:=xlAutoOpen

TIA
J_J
 
T

Tushar Mehta

Hopefully, XL will give you the necessary code with the procedure
below...
Open a workbook. Create a new workbook. Turn on the macro recorder
(Tools | Macro > Record new macro...). Switch to the first workbook.
Close it. Turn off the macro recorder. Switch to the VBE.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
T

Tushar Mehta

You are welcome and, hey, we all have those days! :)

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

Thanks Tushar,
Now why didn't I think of that !.
Sincerely
J_J
{snip}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top