Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
aauugghhh...#div/o problems & various average formula problems acbel40 Excel Worksheet Functions 5 October 19th 09 05:00 PM
Problems in running a macro in another workbook dhatul Excel Discussion (Misc queries) 3 January 20th 06 08:01 AM
Office Small Business ver. 2003 has problems running in XP pablo5551 Excel Discussion (Misc queries) 0 April 26th 05 02:14 AM
Problems running a sub having arguments Stuart[_5_] Excel Programming 5 October 17th 03 05:41 AM
More UDF problems; some won't update, some won't stop running! Keith R[_3_] Excel Programming 0 August 1st 03 02:01 PM


All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"