Opening/Closing workbooks without dialog boxes

S

Steve :)

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 :)
 

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

Top