Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems running my app more than once
I wrote a little VBA app that reads some data from a workbook and
creates a new one based on the information. Well if certain information from the source book is invalid I report it to the user to correct and then rerun the app. However if you rerun the app after correcting the source workbook the final created workbook isn't always the same. However if you save your data, exit excel and reopen and run it is always consistant. I do have a few globals in the app.. Is there something I need to do in order to reset all data to initial values? (Here are my globals) Option Explicit Private ID() As String, amnt() As Currency, ArraySize As Integer, ArrayPos As Integer, ERRORS As Boolean Thanks Eric |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems running my app more than once
If you your code writes values to your globals, and you don't do anything to
reset them, then they will continue to hold those values until you hit and END statement (which also immediately halts excecution) or you modify them (or manually do a reset in the vbe or close the workbook). It is unclear how your code initializes these globals, but if it could leave residual values, then that might be the source of the problem. You can look at help on the Erase command for information on clearing dynamic arrays. For other variables, just set the value you want (which your code should be doing anyway). -- Regards, Tom Ogilvy "Eric Wescott" wrote in message om... I wrote a little VBA app that reads some data from a workbook and creates a new one based on the information. Well if certain information from the source book is invalid I report it to the user to correct and then rerun the app. However if you rerun the app after correcting the source workbook the final created workbook isn't always the same. However if you save your data, exit excel and reopen and run it is always consistant. I do have a few globals in the app.. Is there something I need to do in order to reset all data to initial values? (Here are my globals) Option Explicit Private ID() As String, amnt() As Currency, ArraySize As Integer, ArrayPos As Integer, ERRORS As Boolean Thanks Eric |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
aauugghhh...#div/o problems & various average formula problems | Excel Worksheet Functions | |||
Problems in running a macro in another workbook | Excel Discussion (Misc queries) | |||
Office Small Business ver. 2003 has problems running in XP | Excel Discussion (Misc queries) | |||
Problems running a sub having arguments | Excel Programming | |||
More UDF problems; some won't update, some won't stop running! | Excel Programming |