Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
The instruction at "0x65255ac9" referenced memory at "0x00000008". The memory could not be read. Clikc OK to terminate etc
Hello
I had a problem with my Excel 97 spreadsheet causing this error. I had macros in the spreadsheet - when I selected Do Not enable macros when I opened the spreadsheet the problem went away (but obviously I lost the macro functionality!). Does anyone have any tips on avoiding these memory access errors? I am not sure if this solved it but I had an event function which seemed to crash on this line: if m_bEvents = false then exit sub I had declared m_bEvents like this: Dim m_bEvents I changed to Dim m_bEvents As String which seemed to get rid of the problem. However, for a test I put back to just Dim m_bEvents and the error didn't re-appear. so I was confused. I also changed the name m_bEvents to m_bTriggerEvents in case m_bEvents was an Excel reseved variable. Any clues as to why I experienced this problem? Angus Comber |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
The instruction at "0x65255ac9" referenced memory at "0x00000008". The memory could not be read. Clikc OK to terminate etc
No real answer I am afraid, but a couple of observations.
You do not show where the faulty(?) line occurred. Was it in code that ran during the opening of the sheet ? ie. was any code actually running ? '-------------------------------------- <<I had declared m_bEvents like this: <<Dim m_bEvents This Dim method will default as if you had put :- Dim m_bEvents As Variant thus accepting any data type. '------------------------------------------ <<I changed to Dim m_bEvents As String <<if m_bEvents = false then exit sub These lines are inconsistent because you are using m_bEvents as if it were Boolean, so should have used :- Dim m_bEvents as Boolean. This would probably not cause an error because Excel would obligingly make it ="False" and use it as if you had declared it correctly. '------------------------------------------ <<I also changed the name m_bEvents to m_bTriggerEvents in case m_bEvents was an Excel reseved variable. To test for reserved names in the VB Editor, type the word and press F1 key (not 100% reliable). Cannot see any problem with this. '------------------------------------------ On the whole, although not 100% correct, I cannot see any real problem with your code - which suggests a corrupted module. I always get a corrupted module if I accidentally declare the same variable twice and try to run the code (XL97). Copy/paste the code into NotePad. Delete your module. Then Copy/Paste code back from NotePad into a new module. Regards BrianB ================================= "Angus Comber" wrote in message ... Hello I had a problem with my Excel 97 spreadsheet causing this error. I had macros in the spreadsheet - when I selected Do Not enable macros when I opened the spreadsheet the problem went away (but obviously I lost the macro functionality!). Does anyone have any tips on avoiding these memory access errors? I am not sure if this solved it but I had an event function which seemed to crash on this line: if m_bEvents = false then exit sub I had declared m_bEvents like this: Dim m_bEvents I changed to Dim m_bEvents As String which seemed to get rid of the problem. However, for a test I put back to just Dim m_bEvents and the error didn't re-appear. so I was confused. I also changed the name m_bEvents to m_bTriggerEvents in case m_bEvents was an Excel reseved variable. Any clues as to why I experienced this problem? Angus Comber |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
The Instruction at "0x749860a0" referenced memory at "0x00000000" | Excel Discussion (Misc queries) | |||
Very Wierd Execl "Memory" problem | Excel Discussion (Misc queries) | |||
Bogus "Out of memory" Warning in VBE? | Excel Discussion (Misc queries) | |||
"Not Enough Memory" new macros problem | Excel Programming |