Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

close without saving

Status
Not open for further replies.

alring

Technical User
Nov 11, 2005
18
DK
I have made a macro in Excel 2003 that open and print another Excel document. Now I want the same macro to close that document I opened and printet. But it have to close without saving. I have tried to record it but then I'm ask if I want to save. I'm trying to avoid that quistion.

regards
Mads
 

How about something like this:

Code:
Sub OpenClose()
'
Workbooks.OpenFilename:="C:\Xyz.xls"
'' Modify this workbook:
'' Put code in here

ActiveWindow.Close (False)
    
End Sub


TomCologne
 
Hi TomClogne

Thank you. It works.

Mads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top