ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open a closed workbook with VBA (https://www.excelbanter.com/excel-programming/330417-re-open-closed-workbook-vba.html)

ttomlinson

Open a closed workbook with VBA
 

I have managed to open the workbook but not close it

to open I am using the code

Application.Workbooks.Open ("E:\Documents an
Settings\Trevor\Desktop\B.xls")

This works fine. How do I close though I have tried

Application.Workbooks("E:\Documents an
Settings\Trevor\Desktop\B.xls").Close

and

Application.Workbooks.Close("E:\Documents an
Settings\Trevor\Desktop\B.xls")

neither work.

Where have I gone wrong there?

Thanks
Tre

--
ttomlinso
-----------------------------------------------------------------------
ttomlinson's Profile: http://www.excelforum.com/member.php...fo&userid=2383
View this thread: http://www.excelforum.com/showthread.php?threadid=37490



All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com