Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto close read-only, question boxes?


I'm new to VB and I've written a macro that opens a second spreadsheet,
pulls data, and then closes the spreadsheet. What kind of code can I
put in the macro to automatically choose the "read only" option when
opening the spreadsheet and then automatically not save changes made to
the spreadsheet and automatically not save the data on the clipboard to
use later? Any help would be appreciated. Thanks all.


--
sefus12
------------------------------------------------------------------------
sefus12's Profile: http://www.excelforum.com/member.php...o&userid=32755
View this thread: http://www.excelforum.com/showthread...hreadid=526842

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Auto close read-only, question boxes?

dim wkbk as workbook

set wkbk = workbooks.open(filename:="C:\yourfilename.xls", readonly:=true)
'do a bunch of work

wkbk.close savechanges:=false

You'll see a lot of options you can specify in the .Open line when you look at
VBA's help.



sefus12 wrote:

I'm new to VB and I've written a macro that opens a second spreadsheet,
pulls data, and then closes the spreadsheet. What kind of code can I
put in the macro to automatically choose the "read only" option when
opening the spreadsheet and then automatically not save changes made to
the spreadsheet and automatically not save the data on the clipboard to
use later? Any help would be appreciated. Thanks all.

--
sefus12
------------------------------------------------------------------------
sefus12's Profile: http://www.excelforum.com/member.php...o&userid=32755
View this thread: http://www.excelforum.com/showthread...hreadid=526842


--

Dave Peterson
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
text boxes retaining their last value on form close and restart NDBC Excel Discussion (Misc queries) 3 July 1st 09 12:55 PM
Auto close the prompt & dialog boxes HelpEachOther Excel Programming 2 December 21st 05 02:51 AM
Automatically Close Dialog Boxes chriskane Excel Worksheet Functions 2 August 9th 05 12:14 PM
Auto Excel workbook close: save= false during an auto subroutine tomwashere2 Excel Programming 10 June 16th 05 06:23 AM
Question on Input Boxes and Auto-Filter golf4 Excel Programming 5 March 7th 04 04:10 AM


All times are GMT +1. The time now is 05:20 AM.

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

About Us

"It's about Microsoft Excel"