Error open spreadsheet from mail link that opens it in inter

Brian

Board Regular
Joined
Apr 24, 2002
Messages
113
I created a spreadsheet that has auto_open, workbook_Open, and window_activate event subroutines. When I open from Excel, it all works fine. When I open via a link in my e-mail (Which happens to be Novell Groupwise) it opens the spreadsheet within internet explorer, I get Automation Error 440. The line that fails is:

With Application.CommandBars("cells")
Set temp = .Controls.Add(msoControlButton)

It appears that my subroutine cannot find the "cells" command bar (this is the built in shortcut menu obtained by right-clicking a cell). Simply upgrading my version of ie or changing to Netscape won't help because I can't upgrade all of the other users.

I have tried:

1) Adding a 10 second wait in workbook_Open, and window_activate event subroutines. It waits, but then continues as before.
2) Commenting out the auto_open sub. No change.
3) Remove sub calls from workbook open to another sub and then run manually after opening. Open fine, but fails the same when I manually run the macro.

None worked. Yet if I right-click the spreadsheet, the "cells" menu does appear.

After ending the first error, when I perform an action that trys to enable/disable the control that was added to the shortcut bar, then I get an error. When I "end" that error, excel crashes with a fatal exception error.

I am at a loss. For now, my work-around is that I'll send a link to the directory and have people open the file from the directory.

Any suggestions?


REF ====================================
Private clcmd As Long

'Sub auto_open()
'clcmd = Application.Calculation
'Application.Calculation = xlManual
'End Sub


Private Sub Workbook_Open()
'2002-05-03: Created by Brian West
' Display a message box dialog when the workbook opens.

WaitForXsecs (10)

msgbox (...)
{snip ...}

End sub


Sub WaitForXsecs(SecondsToWait)
' 2002-05-06: Created by Brian West
' From MS Help
' This example pauses a running macro for approximately 10 seconds.

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + SecondsToWait
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

End Sub

Private Sub Workbook_Activate()
' 2002-05-04: Created by Brian West
' Recalc the sheet when selected,
' otherwise sometimes all of the rows appear blue,
' even when in automatica calculation.
BasicReCalcNow
CustomiseShortcutMenu ("Cell") '
CustomiseShortcutMenu ("Row")
DisableShortcutMenu ("Cell")
DisableShortcutMenu ("Row")
End Sub

Sub CustomiseShortcutMenu(TargetMenu As String)
'2002-04-26: Created by Brian West
'From MrExcel Messageboard - Works!
With Application.CommandBars(TargetMenu)
Set temp = .Controls.Add(msoControlButton) '<------FAILS HERE AS IF COMMANDBAR "CELLS" DOES NOT EXIST.
temp.Caption = "Insert Spec Rows"
temp.OnAction = "InsertRowCopyAutoNumCells"
temp.BeginGroup = True
End With

{SNIP}

EndSub
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,214,376
Messages
6,119,174
Members
448,870
Latest member
max_pedreira

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top