Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel XP compatibility with 2000 1

Status
Not open for further replies.

cyork

MIS
Apr 4, 2001
34
0
0
CA
Hi,

I have developed an application in Excel XP which causes several errors when run on an earlier version of Excel.

The first error occurs in the auto_run macro where I attempt to create a button with the following code:

Set bb = Application.CommandBars(1).Controls.Add(msoControlButton)
bb.Style = msoButtonIconAndCaption
bb.Caption = "Inputs &Wizard"
bb.FaceId = 651
bb.OnAction = "ShowMainForm"

This seems to work fine on XP but not 2000 - any thoughts.

Chris
 
No reason why it shouldn't. Make sure your mso constant actually has a value. If not, you may need to set a reference to the VBA extensibility library.
What happens in XL2000 when you execute the code?

Hey - wait a minute. You're adding a button control directly to the standard menu bar? That's an odd thing to do. Perhaps commandbars(1) is not the standard menu bar in XP?

Rob
[flowerface]
 
Hi Rob,

The was "An Error Occured in a Hidden Module" of something along those lines...it was on someone else's PC so I need to play around with it as soon as I find a PC with Excel 2000 on it :).

About the button, I know that placing it on the main menu bar is unorthodox but it seems to have the best visibility for the user...the button is removed when the program is shut-down.

I'll investigate the situation further and post and update.

Thanks!

Chris
 
Hi Rob,

I just ran the app on 2 PCs with XL 2000 and each time I get strange erros such as XL not recognizing the "str" function... Is something wrong with the libraries?

Chris
 
Sounds odd. Not something I've encountered - can you post the exact code where the error occurs? I do recall some thread here not too long ago mentioning broken references - it's worth going to tools - references, and see if any are marked as missing - then fixing them.
Rob
[flowerface]
 
Hi Rob,

I'm going nuts over here :). I installed XL2000 on my home PC and the app runs fine... The problem seems to vary by PC (XL install). The code that wasn't working on the 2 other PCs at work includes what I posted earlier but also it does not recognize the "str" command:


dim variable1 as srting

variable1 = str(AnyNumber)


It seems to me that this is a reference problem...

I checked the references on my PC (with XL 2000 that works), it included the following:

- VB for Apps
- MS XL 9.0 Object Library
- OLE Automation
- MS Office 9.0 Object Library
- MS Forms 2.0 Object Library

I did notice that on the other PCs (where XL 2000 did not work) there was one additional reference:

- Missing: MS Office XP Web Components

I didn't think that the missing part would impact anything since I don't use that reference for anyting...

 
Rob,

I think that the "Missing: MS Office XP Web Components" reference may have been causing the problems...I don't understand why but this seems to have been affecting many common functions. I'll try running it again tomorrow morning on the PCs which gave me grief and I'll let you know.

Thanks again,

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top