Compatibility - Compile Error

R

Renato

I have the following code on a worksheet:

Sub AddNewMenu()
Dim HelpIndex As Integer
Dim NewMenu As CommandBarPopup

' Get Index of Help menu
HelpIndex = CommandBars(1).Controls("Help").Index

' Create the control
Set NewMenu = CommandBars(1) _
.Controls.Add(Type:=msoControlPopup, _
Before:=HelpIndex, Temporary:=True)
' Add a caption
NewMenu.Caption = "&Michigan"
End Sub

I never had problems with it until recently. I run vista with office 2007.
Everytime I save a file with the code the other person opening it gets an
error (Compile Error in Module 1). The file is saved as 97-2003. We have
not issues with 2007 Excles only with previous versions of excel. It seems
like it can't run that code at all. So any suggestions would be aprreciated.



Renato
 
B

Bob Flanagan

Ask the person getting the error to

search for and delete or rename all files of type EXD. Typically there are
2-4 on a pc.
Do a repair of Office in Control Panel, Add/Remove programs.

second from worst case solution:
delete EXD files
delete all files in all temp folders everywhere
reboot, un-install office, reboot, re-install office.

worst case solution:
buy new PCs until it works.

The problem is a common problem I think that is caused by installing SP
releases from Microsoft. I had a copy of Excel working fine, ran the SP3
upgrade, and boom, error in module 1... And the same problem after doing
the Office 2007 upgrade.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top