Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel 2003 VBscript Picky To Run

Posted on 2011-02-10
4
Medium Priority
?
337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

670 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