Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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




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
Excel 2007 Read-ony issue read-only file status issue in excel Excel Discussion (Misc queries) 0 May 17th 10 04:50 PM
excel 2002 read only issue car-on Excel Discussion (Misc queries) 1 November 1st 08 04:35 AM
I have a read only xl file, I need it to be read and write drama queen Excel Discussion (Misc queries) 3 July 1st 06 12:25 AM
XCEL FILE REC'D AS READ ONLY -- HOW TO NOT BE "READ ONLY" billybob Excel Discussion (Misc queries) 1 February 13th 06 03:14 AM
How can a file be converted from Read-Only to Read/Write Jim in Apopka Excel Discussion (Misc queries) 2 November 19th 05 04:59 PM


All times are GMT +1. The time now is 08:28 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"