Solved

Excel 2003 VBscript Picky To Run

Posted on 2011-02-10
4
333 Views
Last Modified: 2012-05-11
Has anyone experienced a problem with VBScript being very picky about it's placement in this or that bas file.

I'm running into situations where I can't debug a little scriplet because Excel does not even seem to be able to identify the function name. If I move that same function into a new module, Excel mysteriously sees it and everything is beautiful again... for a while. Then I end up in the same mess all over again.

Should I chuck this thing and upgrade to Excel 2010?

Thanks.
0
Comment
Question by:gbmcneil
  • 2
4 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34866726
The proper location for code is no different in any version. As a basic rule, unless you are using an event routine, all code should be in a normal module, not in a worksheet module or the ThisWorkbook module.
0
 
LVL 6

Accepted Solution

by:
FernandoFernandes earned 250 total points
ID: 34866758
also, please try not to
1) make those huge gigantic modules with all your functions and subroutines only in on module.
2) make sure your modules do not have more than 1000 lines of code...
3) make sure you're able to do Debug / Compile as this checks for all the sintax, and may help finding possible errors
0
 

Author Closing Comment

by:gbmcneil
ID: 34988424
Thanks Fernando.
0
 
LVL 6

Expert Comment

by:FernandoFernandes
ID: 34988810
;-)
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question