View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Solution: Macro syntax to open file in current explorer folder

If you want to discard any changes:
workbooks("AmsAll-1.prn").close savechanges:=false

If you want to save the changes:
application.displayalerts=false
workbooks("AmsAll-1.prn").close savechanges:=true
application.displayalerts=true

wrote:

Thanks Dave and Tim,

The following worked great on Excel 97, I trust it will also work on
Excel 2000:

Workbooks.OpenText FileName:=ActiveWorkbook.Path() &
"\AmsAll-1.prn", _

While I am posting, is there a way for a macro to provide the two 'N'
responses that are mandatory to complete the file close process (the
first to close without saving, the second to discard the information
copied to the clipboard). These are the statements that I use to close
the prn file
Windows("AmsAll-1.prn").Activate
ActiveWorkbook.Close

I checked the Close command, it has one optional argument (a file
list), no other clues as to how to avoid the two interactive dialog
boxes.

Thanks,
Fred.
2006-01-11(Wed)


--

Dave Peterson