Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Editing a Read Only Excel File via VBE

Hi,

I have an excel file which runs some vbe via the DocumentOpened event
handler. This code involves the proessing of data, the results of which
are plotted within the excel doc. Finally, the event handler saves the
doc so that when you close it, you are not propted to save the file.
The problem is, I dont what the file to be editable after the event
handler has run. In otherwords, I want to set it to read-only after I
exit the handler.

How might I do this?

Thanks,

Barry.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Editing a Read Only Excel File via VBE

Try something like the following in the ThisWorkbook code module:

Private Sub Workbook_Open()
'''''''''''''''''''''''
' your code here
''''''''''''''''''''''
Application.DisplayAlerts = False
ThisWorkbook.ChangeFileAccess xlReadOnly
Application.DisplayAlerts = True

End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


wrote in message
ups.com...
Hi,

I have an excel file which runs some vbe via the DocumentOpened event
handler. This code involves the proessing of data, the results of which
are plotted within the excel doc. Finally, the event handler saves the
doc so that when you close it, you are not propted to save the file.
The problem is, I dont what the file to be editable after the event
handler has run. In otherwords, I want to set it to read-only after I
exit the handler.

How might I do this?

Thanks,

Barry.



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
Editing a shared document that has some read-only capabiities asmchi Excel Discussion (Misc queries) 0 December 8th 09 05:12 PM
How can I read & write in a Vlookup cell (same as editing an Acces Bakhsh_UOP Excel Programming 1 December 13th 05 05:50 PM
Pasword protected Excel file encrypted, how do I read this file? jonesteam Excel Discussion (Misc queries) 2 December 12th 05 06:32 PM
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. Tim Marsden Charts and Charting in Excel 2 October 15th 05 02:10 PM
Trying to Open Excel File, But its says file is locked for editing Smeeta Geary Excel Discussion (Misc queries) 1 September 20th 05 01:28 PM


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