Programming for Different Versions

Q

QB

I developped an Excel workbook to automate a previously series of manual
operations. I am working with Excel 2007 (En). It works without any issues
on my laptop.

Certain people are using Excel 2007 (Fr) and when they run it they receive
all sorts of errors?

It highlights part of my code that run without issue for me.

Is VBA language specific? How can I troublehoot my code to ensure it runs
for everyone?

Help!?

Thank you,

QB
 
M

mrkt_rwnd

I once had an issue where regional setting for the treatment of
decimal points and commas affected results. Of course it all depends
what your macro is trying to achieve. Try changing the regional
settings on your machine as a test. Best, J
 
Q

QB

So instead on using a NumberFormat = 0.00 , I might need to use 0,00 or
something else based on the user`s regional settings?

Is there anyway to make adaptive code to take into consideration such issues?


In this particular case, The wrkbk was developed originally in 2003 and has
automation to create a menu with a button. I use the line

Set cbMainMenu = Application.Commandbars(''Worksheet Menu Bar'')
iHelpMenu = cbMainMenu.Controls(''Help'').Index

Now when I run it it work fine. But when others run it It highlights the
last line. After testing I know that it is unable to find the ''Help''
control? Does the Control name change because they are running a Fr version
or does the VBA remain unchanged?

QB
 
B

Brian Murphy

The VBA book by Green and Bovey has a lot of material on this very
topic. If you don't have it, I recommend it highly. I have the 2002
book, not the 2007 book. I ought to get it myself come to think of
it.

Brian Murphy



Excel 2007 VBA Programmer's Reference
Authors: John Green (Editor), Michael Alexander, Stephen Bullen, Rob
Bovey
Format: Paperback, 1176 pages
Publication Date: March 2007
Publisher: Wrox Pr Inc
Dimensions: 9.25"H x 7.25"W x 2.25"D; 3.2 lbs.
ISBN-10: 0470046430
ISBN-13: 9780470046432
 
P

Peter T

You can always use the English name of a Commandbar (instead of its local
name), but for controls best to find them with their ID

Set cbMainMenu = Application.CommandBars("Worksheet Menu Bar")
debug.print cbMainMenu.Controls("Help").ID ' 30010 ' in development only
iHelpMenu = cbMainMenu.FindControl(ID:=30010).Index

Regards,
Peter T
 

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