I
imelda1ab
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.
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.