Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Add-In problem under new SOE

New Rule

Do not stick your subs in a module that is named the same as the sub - fixed, seems to work fine now. This all happened because I was trying to be Tidy. Oh Well Live and learn.

Thanks anyway guys.
"Gav !!" wrote in message ...
Folks

We have recently upgraded our SOE from NT4 to XP and all was well until I continued to work on an Excel App I had been writing and saving as an Add-In. The laptop I am writing this on last week was SOE5 ( NT4) Office 2000 now SOE6(XP)Office XP. Last week my drop down menu ( next to help ) ran fine and all subs worked ), this week when I updated the add-in with new code the subs I have written this week do not run but the old ones from the menu still do. The new ones give an error message something like XXX.xla!SubName cannot be found, and yet in the back end it is in the xla and if run from the backend it seems to work fine. Could someone please let me know if the code has changed toward the way a menu is created in XP, and what the new syntax if any would be.

here is a sample only of my menu structure, i think originally learnt from John W.

Option Explicit

Sub Auto_Open()



' Creates a new menu and adds menu items
Dim Cap(1 To 6)
Dim Mac(1 To 6)
Dim MenuName As String

MenuName = "&XXXXAnalysis"

Cap(1) = "Analyse The Data"
Mac(1) = "AnalyseData"
Cap(2) = "Adds the XXXX and XXXX"
Mac(2) = "addxxxx"
Cap(3) = "Puts in Sections"
Mac(3) = "addsections"
Cap(4) = "Prepares Dates for Runing Times"
Mac(4) = "Prepare_Dates"
Cap(5) = "Places Times into Sheet"
Mac(5) = "GetTimes"
Cap(6) = "Colour Legend"
Mac(6) = "Legend"


On Error Resume Next
' Delete the menu if it already exists
MenuBars(xlWorksheet).Menus(MenuName).Delete

' Add the menu
MenuBars(xlWorksheet).Menus.Add Caption:=MenuName, befo="Help"

' Add the menu items
With MenuBars(xlWorksheet).Menus(MenuName).MenuItems
.Add Caption:=Cap(1), OnAction:=Mac(1)
.Add Caption:="-"
.Add Caption:=Cap(2), OnAction:=Mac(2)
.Add Caption:=Cap(3), OnAction:=Mac(3)
.Add Caption:="-"
.Add Caption:=Cap(4), OnAction:=Mac(4)
.Add Caption:=Cap(5), OnAction:=Mac(5)
.Add Caption:="-"
.Add Caption:=Cap(6), OnAction:=Mac(6)

End With
End Sub

Sub Auto_Close()
Dim MenuName As String
MenuName = "&ATP Analysis"
' Delete the menu before closing
On Error Resume Next
MenuBars(xlWorksheet).Menus(MenuName).Delete
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
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
Add-In problem Barb Reinhardt Excel Discussion (Misc queries) 1 March 29th 07 02:03 PM
IF(AND(etc., etc. ... problem Nicole Seibert Excel Worksheet Functions 2 July 20th 06 01:13 PM
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
problem with a conditional max problem Brian Cornejo Excel Discussion (Misc queries) 1 February 18th 05 06:25 PM


All times are GMT +1. The time now is 12:32 AM.

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"