Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Problems On Shutdown with Excel/VBA App

I have been writing an app to automate some of the
accounting processes at work and am using Excel as a basis
for this app. I have created a front page which is
basically an Excel form with various buttons and combo
boxes on it to allow the user to move between different
parts of the program without having to use it in an excel
like way and to run various bits of VB code.
The problem I am having is when the program shuts down:
The user presses the Exit button (I have disabled the
normal close procedure to ensure the program data is up to
date before it is closed) to exit and then I get a series
of four Compilation Errors that a variable has not been
defined. The variable in question is the name of one of
the controls on the front page and does exist (all of the
code works fine when the program is open). If I reference
the control explicitly using Sheets("Sheet
Name").ControlName then the problem cascades onto another
control until I reference them all explicitly at which
time I get told that the object do not exist. I have
Option Explicit set in all modules.

What I assume is happening is this:
When the program closes down, the sheet containing the
front page is removed from memory and THEN it tries to
compile allthe code again, resulting in the compilation
errors. What I don't know is WHY this happens and how I
can solve it. Can any one help out?

Thanks In Advance,

Tim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Problems On Shutdown with Excel/VBA App

I have a somewhat similar problem. The macro works fine
when open, but as soon as I close it and reopen the file,
the macro doesn't work properly. Has anyone been able to
help you with this issue?

Thanks,
Bryce

-----Original Message-----
I have been writing an app to automate some of the
accounting processes at work and am using Excel as a

basis
for this app. I have created a front page which is
basically an Excel form with various buttons and combo
boxes on it to allow the user to move between different
parts of the program without having to use it in an excel
like way and to run various bits of VB code.
The problem I am having is when the program shuts down:
The user presses the Exit button (I have disabled the
normal close procedure to ensure the program data is up

to
date before it is closed) to exit and then I get a series
of four Compilation Errors that a variable has not been
defined. The variable in question is the name of one of
the controls on the front page and does exist (all of the
code works fine when the program is open). If I reference
the control explicitly using Sheets("Sheet
Name").ControlName then the problem cascades onto another
control until I reference them all explicitly at which
time I get told that the object do not exist. I have
Option Explicit set in all modules.

What I assume is happening is this:
When the program closes down, the sheet containing the
front page is removed from memory and THEN it tries to
compile allthe code again, resulting in the compilation
errors. What I don't know is WHY this happens and how I
can solve it. Can any one help out?

Thanks In Advance,

Tim
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Problems On Shutdown with Excel/VBA App

Not so far, I have checked with other developers, & our
corporate IT to no avail. Hopefully someone here will know
something about it.

Tim

-----Original Message-----
I have a somewhat similar problem. The macro works fine
when open, but as soon as I close it and reopen the file,
the macro doesn't work properly. Has anyone been able to
help you with this issue?

Thanks,
Bryce

-----Original Message-----
I have been writing an app to automate some of the
accounting processes at work and am using Excel as a

basis
for this app. I have created a front page which is
basically an Excel form with various buttons and combo
boxes on it to allow the user to move between different
parts of the program without having to use it in an

excel
like way and to run various bits of VB code.
The problem I am having is when the program shuts down:
The user presses the Exit button (I have disabled the
normal close procedure to ensure the program data is up

to
date before it is closed) to exit and then I get a

series
of four Compilation Errors that a variable has not been
defined. The variable in question is the name of one of
the controls on the front page and does exist (all of

the
code works fine when the program is open). If I

reference
the control explicitly using Sheets("Sheet
Name").ControlName then the problem cascades onto

another
control until I reference them all explicitly at which
time I get told that the object do not exist. I have
Option Explicit set in all modules.

What I assume is happening is this:
When the program closes down, the sheet containing the
front page is removed from memory and THEN it tries to
compile allthe code again, resulting in the compilation
errors. What I don't know is WHY this happens and how I
can solve it. Can any one help out?

Thanks In Advance,

Tim
.

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems On Shutdown with Excel/VBA App

I don't know what your code is doing when these
compilation errors happen, but it might help to disable
application events while it is running, something like
this:

Application.EnableEvents = False
[ code during which errors come up ]
Application.EnableEvents = True


-----Original Message-----
I have been writing an app to automate some of the
accounting processes at work and am using Excel as a

basis
for this app. I have created a front page which is
basically an Excel form with various buttons and combo
boxes on it to allow the user to move between different
parts of the program without having to use it in an excel
like way and to run various bits of VB code.
The problem I am having is when the program shuts down:
The user presses the Exit button (I have disabled the
normal close procedure to ensure the program data is up

to
date before it is closed) to exit and then I get a series
of four Compilation Errors that a variable has not been
defined. The variable in question is the name of one of
the controls on the front page and does exist (all of the
code works fine when the program is open). If I reference
the control explicitly using Sheets("Sheet
Name").ControlName then the problem cascades onto another
control until I reference them all explicitly at which
time I get told that the object do not exist. I have
Option Explicit set in all modules.

What I assume is happening is this:
When the program closes down, the sheet containing the
front page is removed from memory and THEN it tries to
compile allthe code again, resulting in the compilation
errors. What I don't know is WHY this happens and how I
can solve it. Can any one help out?

Thanks In Advance,

Tim
.

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
Customized buttons cause Excel shutdown in Vista? RAL/PSCN[_2_] Excel Discussion (Misc queries) 0 April 15th 09 10:11 PM
excel.exe has generated errors and will be shutdown by windows jcook Excel Discussion (Misc queries) 0 April 22nd 08 02:20 PM
Timed shutdown of spreadsheet Steve Excel Discussion (Misc queries) 13 August 31st 07 02:18 PM
excel shutdown MRR Excel Discussion (Misc queries) 0 July 20th 06 01:58 PM
UPS Shutdown script clayton Excel Discussion (Misc queries) 2 December 13th 05 02:53 AM


All times are GMT +1. The time now is 01:05 AM.

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"