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

Excel XP & Win XP
I need to save a file in VBA and set the attribute to Read-Only. I know
how to save it but don't know how to set the attribute. What is the correct
code for that? Thanks for your time. Otto


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Save file as Read-Only


maybe something like this, just use your own variables:

Workbooks(wb).SaveAs Filename:=fPath & fName, ReadOnlyRecommended:=True
--


Gary


"Otto Moehrbach" wrote in message
...
Excel XP & Win XP
I need to save a file in VBA and set the attribute to Read-Only. I know
how to save it but don't know how to set the attribute. What is the correct
code for that? Thanks for your time. Otto



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Save file as Read-Only

Gary
Thanks for your time. That didn't set the attribute such that when you
right-click on the file name - properties, you see the Read-Only box
checked. What it did create was a query when the file is opened asking if
you want to open it as Read-Only.
Do you know of a way to make the file Read-only such that when you open
it, it is Read-only, period?
"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...

maybe something like this, just use your own variables:

Workbooks(wb).SaveAs Filename:=fPath & fName, ReadOnlyRecommended:=True
--


Gary


"Otto Moehrbach" wrote in message
...
Excel XP & Win XP
I need to save a file in VBA and set the attribute to Read-Only. I
know how to save it but don't know how to set the attribute. What is the
correct code for that? Thanks for your time. Otto





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Save file as Read-Only

Otto,
The SetAttr statement only works on closed files...
Sub DoItToIt()
SetAttr "C:\My Documents\Word & Text Docs\MyFile.doc", vbReadOnly
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Otto Moehrbach"
wrote in message
Excel XP & Win XP
I need to save a file in VBA and set the attribute to Read-Only. I know
how to save it but don't know how to set the attribute. What is the correct
code for that? Thanks for your time. Otto


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
How do you save an excel file to be read as IBM-type text file ? Dee Franklin Excel Worksheet Functions 2 October 10th 06 02:46 AM
Autoname a save as file from a cell in a read only file g4rod Excel Discussion (Misc queries) 2 October 6th 06 01:16 PM
cant save read only file pglm Excel Discussion (Misc queries) 2 September 15th 06 02:02 PM
How to save a PC Excel file into MAC (it says file is read only)? claudiosissa Excel Discussion (Misc queries) 0 November 30th 05 01:57 AM
Trying to save a .XLA file that's Read Only silkworm Excel Programming 4 November 12th 05 01:22 AM


All times are GMT +1. The time now is 08:02 PM.

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"