ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Closing a named workbook? (https://www.excelbanter.com/excel-programming/357013-closing-named-workbook.html)

drucey[_18_]

Closing a named workbook?
 

Hi all,

I have a generated filesearch list of files, in a master workbook (FM
Purchase Order.xls).

Is there a macro that i can put in the auto_open bit of the searched
files, to say:

If there is an workbook open called "FM Purchase Order.xls", close it.



Thank you!


--
drucey
------------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=526037


Ardus Petus

Closing a named workbook?
 
Sub test()
On Error Resume Next
Workbooks("FM Purchase Order.xls").Close
On Error GoTo 0
End Sub

HTH
--
AP


"drucey" a écrit dans
le message de ...

Hi all,

I have a generated filesearch list of files, in a master workbook (FM
Purchase Order.xls).

Is there a macro that i can put in the auto_open bit of the searched
files, to say:

If there is an workbook open called "FM Purchase Order.xls", close it.



Thank you!


--
drucey
------------------------------------------------------------------------
drucey's Profile:

http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=526037




drucey[_20_]

Closing a named workbook?
 

Artus, you are amazing.


--
drucey
------------------------------------------------------------------------
drucey's Profile: http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=526037



All times are GMT +1. The time now is 12:09 AM.

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