LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Open Workbook Read Only and hide select worksheets

Something I thought would be so simple has turned into a nightmare. I
need to open a workbook named index.xls Read Only and then hide 25 of
the 26 worksheets. Yes, I tried to create a new workbook and paste
link of the one worksheet I need, but the workbook is heavy laden with
formulae, formatting, etc. so it crashes everytime I attempt to
paste. So, I'm going for Plan II and it has to be dummy proof for the
users. No protection; no passwords; not based on userlogin.

My question is, is there a way to open UserIndex.xls with it's
Workbook_Open code and somehow "call" the macro ShowMySheetOnly to run
in the Read Only? The macros work perfectly separately, but I cannot
figure out how to combine them so the user only has to open the one
document?

What I have for the two docs:

UserIndex.xls opens FileIndex.xls read only:

Sub Workbook_Open()
Workbooks.Open Filename:="C:\medcenter\index.xls",
ReadOnly:=True
Workbooks("index.xls").Activate
End Sub

Hide all worksheets but Sheet1 in FileIndex.xls:
Sub ShowMySheetOnly()
Dim Wks As Worksheet
For Each Wks In ThisWorkbook.Worksheets
If Wks.Name < "Sheet1" Then
If Wks.Visible = xlSheetVisible Then Wks.Visible =
xlSheetHidden
End If
Next Wks
End Sub

Thank you to any and all who offer their insight/suggestions, etc.
 
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
Use hyperlink to open workbook read only? Clif McIrvin[_2_] Excel Discussion (Misc queries) 3 April 9th 10 02:48 AM
Need VBA Code to Open a Workbook in read only zulfer7 Excel Discussion (Misc queries) 1 July 10th 06 11:00 PM
Running a macro in a open as read-o Workbook TBarreiro Excel Programming 0 September 2nd 05 04:06 PM
Running a macro in a open as read-o Workbook TBarreiro Excel Programming 0 September 2nd 05 04:02 PM
workbook open read only without prompt turbogoat Excel Programming 1 August 26th 04 10:44 PM


All times are GMT +1. The time now is 07:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"