Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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 :)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Opening/Closing workbooks without dialog boxes

application.displayalerts=false

application.cutcopymode=false

Tim

--
Tim Williams
Palo Alto, CA


"Steve :)" wrote in message
...
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 :)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Opening/Closing workbooks without dialog boxes

Hey Tim,

Thank you, I'll give it a try.

Steve R.

On Tue, 20 Sep 2005 12:59:32 -0700, "Tim Williams" <timjwilliams at
gmail dot com wrote:

application.displayalerts=false

application.cutcopymode=false

Tim


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
Disabling formula recalculation when opening or closing workbooks Joe Excel Discussion (Misc queries) 3 August 5th 08 09:24 PM
Dialog box when closing an unsaved spreadsheet Kathy4080 Excel Discussion (Misc queries) 1 January 4th 05 10:28 PM
closing boxes Web_Builder[_2_] Excel Programming 2 October 17th 04 06:11 AM
Opening and Closing workbooks Jase Excel Programming 1 October 15th 03 06:28 AM


All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"