Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an Excel workbook that has a workbook_open() sub that maximizes
the screen and password-protects all of the worksheets. This sub works fine when I save the file on my hard drive or on the network. However, when I embed the file in a Lotus Notes database, the macro immediately errors out on the first line of code (ActiveWorkbook.Unprotect Password:="Password"). It's as if the file is no longer recognized as an Excel file. Any thoughts on how I should rewrite this so that it works both when saved on a network and in Lotus Notes? Sub Workbook_Open() 'I put in this first line of code to find out what the activeworkbook name was upon opening from Lotus Notes. It still errors out (works fine saved on the network). MsgBox "The name of the active Workbook is " & ActiveWorkbook.Name MsgBox "The name of the active Sheet is " & ActiveSheet.Name ' Maximize all windows ActiveWorkbook.Unprotect Password:="Password" Application.WindowState = xlMaximized ActiveWindow.WindowState = xlMaximized ActiveWorkbook.Protect Password:="Password", Structu=True, Windows:=True ' Opens workbook to Table of Contents cell A1 upon opening the workbook. Sheets("Contents").Select Range("a1").Select ' Show splash screen upon opening the workbook SplashForm.Show ' Password-protect all worksheets but lets macros hide/delete Application.ScreenUpdating = False Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets ws.Protect Password:="Password", userinterfaceonly:=True, AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True ws.EnableSelection = xlNoRestrictions Next ws Application.ScreenUpdating = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula to confirm entry in Col "C" is valid for data in Col "A" | Excel Discussion (Misc queries) | |||
=IF(VLOOKUP(C11,Group,2,FALSE)=D11,"True","Not Valid") and =IF(D1 | Excel Worksheet Functions | |||
Lotus 123 has a function called "rvbalance", does excel have? | Excel Worksheet Functions | |||
Lotus Notes - Can't do multiple "Send Tos" | Excel Programming | |||
"Clean Me" Macro is giving "#VALUE!" error in the Notes field. | Excel Programming |