Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |