Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Crashing when changing global const

Status
Not open for further replies.

Chance1234

IS-IT--Management
Jul 25, 2001
7,871
US
This ones got me,

when i try to comma out a global const in my code excel crashes.

I have exported, reimported everything

the global const is not called until a user hits a button so there is no code in the start up routine ihave that would call it.

any dieas on where to begin

Chance,

F, G + HH
 
Hi Chance,

how does Excel crash exactly? Any messages?

Can you show some of your code too?

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 





Hi,

"the global const is not called until a user hits a button "

What difference does that make?

The complier assigns memory for ALL variables and constants at run time, I beleive.

But what difference would that make to an action that you take BEFORE run time: commenting out your global constant???

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Exactly, extremly miffed.

The following is the lines

Code:
'Global Const str_clientpath As String = "\\XXXXX\clients" ' Live version
Global Const str_clientpath As String = "\\YYYYYY\clients"  'development


sometimes i get a

This action will reset your project

mopst of the time it crashes.


Chance,

F, G + HH
 




You CANNOT do that in a break! VB has already assigned the constant.

You must do the BEFORE runtime.
It would be like trying to assign a different value to a constant like a variable.

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Skip,

This is happening before i have ran any code, this is just going into the editor

Chance,

F, G + HH
 
This action will reset your project
So, code IS running ...
 
what code is running is beyond me, This is a bog standard install of excel and there are no thrid party add-ins


Chance,

F, G + HH
 




There must be some event kicking off your code.

Maybe not THIS procedure, but some procedure IS running.

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
copied to new machine, macro security level on high , crashes on open

Chance,

F, G + HH
 




Are Macros Enabled or not?

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
same on enabled and not enabled,

Chance,

F, G + HH
 




If it happens without regard to macros being enabled, then it's not macros within the workbook.

Do you have any other workbook referenced (like a PERSONAL.XLS) or addin. For instance, if I have macros DISABLED, my Personal.xls, which opens whenever Excel opens, can run macros in functions that I have installed in the workbook I disabled macros in.

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
In VBE Tools>Options dialog, 'General' tab, untick 'Notify Before State Loss'. This is useful when working with running project, but generates annoying messages when no code is running too.

combo
 
this one really has us beat, if i remove the module then it works fine,

Chance,

F, G + HH
 
might be a corrupted module

Copy code to notepad
Remove module
Insert new module
Copy code back in

See if it still bugs out

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top