View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steve :) Steve :) is offline
external usenet poster
 
Posts: 2
Default Opening/Closing workbooks without dialog boxes

Fellow users,
It has been a while, hope this finds you all in good health.

Excel 2000 (VBA)
I generated some code using the macro recorder.
The code will open an Excel document, copy some info from it, paste
the info onto a separate workbook, and close the opened document.
The code does this for every Excel document in a directory that I
specify, and that, one at a time. This leaves me with a workbook with
information from all of the workbooks in a directory.

Problem 1:
One problem is that some of the Excel documents are password protected
and prompt me with a dialog box that asks me if I want to open in Read
Only mode, the answer is always yes.
How do I open an Excel document so that I don't have to click the Read
Only button on the dialog box (I'm looking for automation here)?

Problem 2:
After a workbook is closed, I am prompted with another dialog box that
there is still data in the clipboard and do I want to keep it there,
the answer is always no.
How do I keep the application from asking me this using code?

Thanks for any help you can offer,
Steve R :)