Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default "Activeworkbook" function not valid when workbook embedded in Lotus Notes?

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
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
Formula to confirm entry in Col "C" is valid for data in Col "A" VAPCMD Excel Discussion (Misc queries) 2 January 2nd 09 07:58 PM
=IF(VLOOKUP(C11,Group,2,FALSE)=D11,"True","Not Valid") and =IF(D1 Milky Excel Worksheet Functions 1 August 20th 08 08:38 PM
Lotus 123 has a function called "rvbalance", does excel have? wysiwygjack Excel Worksheet Functions 2 July 21st 08 09:51 PM
Lotus Notes - Can't do multiple "Send Tos" SuperJas Excel Programming 4 August 3rd 05 03:24 PM
"Clean Me" Macro is giving "#VALUE!" error in the Notes field. Ryan Watkins Excel Programming 1 June 11th 05 12:25 AM


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