Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Read Only Issue
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Read Only Issue
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 Read-ony issue | Excel Discussion (Misc queries) | |||
excel 2002 read only issue | Excel Discussion (Misc queries) | |||
I have a read only xl file, I need it to be read and write | Excel Discussion (Misc queries) | |||
XCEL FILE REC'D AS READ ONLY -- HOW TO NOT BE "READ ONLY" | Excel Discussion (Misc queries) | |||
How can a file be converted from Read-Only to Read/Write | Excel Discussion (Misc queries) |