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
 
Ad

Advertisements


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

Similar Threads

compile error 1
Compile Error 1
compile error 1
Compile Error 3
Compile Error 0
Compile error 1
compile error 0
Compile error 1

Top