Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Change ReadOnly State

Hi,

is it possible to change the state of a workbook from readonly to readwrite
and vice versa. The workbook is in explorer NOT set to readonly.

I had this in mind, but it doesn't work (code of a excel workbook One.xls)

Function Test() 'open a workbook in readonly mode

Workbooks.Open "c:\Two.xls", False, True

End Function

Function Test2()'After some time, change the state to read/write

Workbooks("Two.xls").ReadOnly = False
[A1] = "Test"
ActiveWorkbook.Save

End Function

Function Test3() 'After the update, change the state again to readonly

Workbooks("Two.xls").ReadOnly = True

End Function

Thanks
Jos Vens



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Change ReadOnly State

Hi Jos

Check out the ChangeFileAccess Method in the VBA help Jos

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Jos Vens" wrote in message ...
Hi,

is it possible to change the state of a workbook from readonly to readwrite
and vice versa. The workbook is in explorer NOT set to readonly.

I had this in mind, but it doesn't work (code of a excel workbook One.xls)

Function Test() 'open a workbook in readonly mode

Workbooks.Open "c:\Two.xls", False, True

End Function

Function Test2()'After some time, change the state to read/write

Workbooks("Two.xls").ReadOnly = False
[A1] = "Test"
ActiveWorkbook.Save

End Function

Function Test3() 'After the update, change the state again to readonly

Workbooks("Two.xls").ReadOnly = True

End Function

Thanks
Jos Vens





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Change ReadOnly State

Thanks Ron,

this is what I needed!

Jos

"Ron de Bruin" schreef in bericht
...
Hi Jos

Check out the ChangeFileAccess Method in the VBA help Jos

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Jos Vens" wrote in message

...
Hi,

is it possible to change the state of a workbook from readonly to

readwrite
and vice versa. The workbook is in explorer NOT set to readonly.

I had this in mind, but it doesn't work (code of a excel workbook

One.xls)

Function Test() 'open a workbook in readonly mode

Workbooks.Open "c:\Two.xls", False, True

End Function

Function Test2()'After some time, change the state to read/write

Workbooks("Two.xls").ReadOnly = False
[A1] = "Test"
ActiveWorkbook.Save

End Function

Function Test3() 'After the update, change the state again to readonly

Workbooks("Two.xls").ReadOnly = True

End Function

Thanks
Jos Vens







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
replace state names with state code abbreviations se7098 Excel Worksheet Functions 3 July 25th 09 06:41 PM
How can I show state-by-state data (as silos) on a map of NA Rob Charts and Charting in Excel 0 November 5th 07 03:41 PM
Converting State Names to State Abbreviations aznate Excel Discussion (Misc queries) 1 October 20th 06 06:52 AM
' Invoice' , change ' State and ZIP' to 'Prov and PC' How? Reirson Excel Discussion (Misc queries) 1 February 3rd 06 07:40 PM
how to change the state of a number in a cell from negative to po. Steve11 Excel Discussion (Misc queries) 1 November 29th 04 07:00 AM


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