Thread: Read Only Issue
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
PJ Usher PJ Usher is offline
external usenet poster
 
Posts: 11
Default Read Only Issue


Hi Ken

I was able to use SetAttr to change the read only property. Thank you very
much for you help.

PJ


"Ken Puls" wrote in message
...
Hi there.

This is written in the reply, and therefore not tested, but hopefully
should work for you.

Dim wb as Workbook
Set wb = Workbooks.Open Filename:="WorkbookB.xls"

'Remove Read only status
SetAttr wb.FullName, vbNormal

'Do stuff here

'Make workbook read only
SetAttr wb.FullName, vbReadOnly

Set wb = Nothing

HTH,

Ken Puls, CMA - Microsoft MVP (Excel)
www.excelguru.ca





PJ Usher wrote:
Excel 2000

I'm trying to write a macro that will automatically update WorkbookB

from
WorkbookA. I have it worked out - almost. The problem is that

WorkbookB
has to have the Read-only checked in it's document property making

saving
the document a little tricky.

In the macro I have
Workbooks.Open Filename:="WorkbookB.xls", Readonly=False
Thinking that it will open WorkbookB in ReadWrite Mode but it still open

as
ReadnOnly.

Is there a way to change a workbook from read only, make document

changes
then save document back with read-only, without changing document name?

Thank you

PJ