Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Save Archive Copy as Read Only

Hi - using RDB6 http://www.rondebruin.nl/copy6.htm in 2003.

I would like to save as read only, how do I modify the save command below to
do this?

TIA,
Anders

'Change all cells in the worksheet to values if you want
If Destwb.Sheets(1).ProtectContents = False Then
With Destwb.Sheets(1).UsedRange
.Cells.Copy
.Cells.PasteSpecial xlPasteValues
.Cells(1).Select
End With
Application.CutCopyMode = False
End If


'Save the new workbook and close it
With Destwb
.SaveAs FolderName _
& "\" & Destwb.Sheets(1).Name & FileExtStr, _
FileFormat:=FileFormatNum
.Close False
End With

End If

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Save Archive Copy as Read Only

You can save as readonly (give a password to modify).
You can save as readonly recommended without a password.
Or you can change the file's attribute to readonly.

If you want either of the first two, record a macro when you do it manually:
File|SaveAs|Tools|General options.

If you want the last, look at SetAttr in VBA's help.



Anders wrote:

Hi - using RDB6 http://www.rondebruin.nl/copy6.htm in 2003.

I would like to save as read only, how do I modify the save command below to
do this?

TIA,
Anders

'Change all cells in the worksheet to values if you want
If Destwb.Sheets(1).ProtectContents = False Then
With Destwb.Sheets(1).UsedRange
.Cells.Copy
.Cells.PasteSpecial xlPasteValues
.Cells(1).Select
End With
Application.CutCopyMode = False
End If

'Save the new workbook and close it
With Destwb
.SaveAs FolderName _
& "\" & Destwb.Sheets(1).Name & FileExtStr, _
FileFormat:=FileFormatNum
.Close False
End With

End If


--

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
Save copy of file to open as read only Ray Clark[_2_] Excel Discussion (Misc queries) 2 June 20th 08 12:19 AM
copy data input to archive access user Excel Programming 5 March 4th 08 10:55 AM
I can not save archive file in excel quocvnf Excel Discussion (Misc queries) 1 April 15th 06 01:50 PM
How to avoid a copy of an unprotected archive? SantistaS Setting up and Configuration of Excel 4 February 21st 06 03:11 PM
Copy & Paste to an Archive Donnie Stone Excel Programming 1 September 18th 03 03:14 AM


All times are GMT +1. The time now is 05:26 PM.

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"