Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why?
This is the situation: I have a code which when i run in the debugger it
works perfect. I set it to run through all at once and it crashes. Why? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why?
You probably have the code in a sheet module and when you make unqualified
references, intending to address the activesheet, those unqualified references instead refer to the sheet containing the code. -- Regards, Tom Ogilvy "Himszy" wrote in message . uk... This is the situation: I have a code which when i run in the debugger it works perfect. I set it to run through all at once and it crashes. Why? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why?
Hi Tom,
Does that mean he has to copy the code out and put it in "general"? "Tom Ogilvy" wrote: You probably have the code in a sheet module and when you make unqualified references, intending to address the activesheet, those unqualified references instead refer to the sheet containing the code. -- Regards, Tom Ogilvy "Himszy" wrote in message . uk... This is the situation: I have a code which when i run in the debugger it works perfect. I set it to run through all at once and it crashes. Why? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why?
Common problems include:
#1. You're running xl97 and call the code using a control from the control toolbox toolbar. If that's the case, change the .takefocusonclick property to false for that control. If it doesn't have that property, add this line to the top of your code: Activecell.activate (This bug was fixed in xl2k.) #2. Your code does selects and activates. When you run the code in the VBE, the correct sheet is active. When you run it "normally" (you didn't say how), the sheet isn't active. For the most part, you don't have to select something to work with it. worksheets("sheet1").select range("a1").select activecell.value = "hi" could be replaced with: worksheets("sheet1").range("a1").value = "hi" ==== If those don't come close, you'll want to post more details. How you run the code, where the code is located, what version of excel and the snippet of code that's causing the trouble. Himszy wrote: This is the situation: I have a code which when i run in the debugger it works perfect. I set it to run through all at once and it crashes. Why? -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why?
Assuming that is actually his problem, not necessarily. You can certainly
qualify references so Excel doesn't have to guess what they refer to. -- Regards, Tom Ogilvy "David" wrote in message ... Hi Tom, Does that mean he has to copy the code out and put it in "general"? "Tom Ogilvy" wrote: You probably have the code in a sheet module and when you make unqualified references, intending to address the activesheet, those unqualified references instead refer to the sheet containing the code. -- Regards, Tom Ogilvy "Himszy" wrote in message . uk... This is the situation: I have a code which when i run in the debugger it works perfect. I set it to run through all at once and it crashes. Why? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|