Closing a named workbook?

  • Thread starter Thread starter drucey
  • Start date Start date
D

drucey

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!
 
Sub test()
On Error Resume Next
Workbooks("FM Purchase Order.xls").Close
On Error GoTo 0
End Sub

HTH
 

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

Back
Top