![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Richland, Washington
Posts: 91
|
I've got a poser. Without getting into a lot of detail, I have a macro that runs like a charm at work, but falls flat on its face at home. At home, it's haunted by that nasty 1004 error, in this case, unable to set the colorindex of some cells.
At work, I'm running Excel 2000 with Windows 2000 on a 1 ghz machine, and at home Excel 97 on Windows ME, with 866 mhz chugging away. I'm guessing that there's something magical about Excel 2000 (or conversely, there are demons that possess a tiny corner of Excel 97.) Does anybody have any perspective on this? Thx. |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Let me make a wild (But, I think accurate) guess.
You're using a Control CommandButton on a sheet, and the TakeFocus******* of that button is set to True. You can do two things: 1. Put: ActiveCell.Select at the top of your macros. 2. Set that Property to FALSE |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Richland, Washington
Posts: 91
|
Juan Pablo - In fact, you're quite right, there is a command button. Also, my heartaches began at the time I started triggering the macro via that button. (It usually is triggered by a change event, but also can launch from the button's macro.) I'll be testing the fix when I get home, tonight. Thanks much.
Do you have any notion as to why that goobers up the code with the one machine, and not the other. Excel versions? The code ran into a different stumbling block at work, yesterday. For some mysterious reason, the code interrupted at its very last step "End Sub", as if you had hit Cntr-Break. It did this several times. Mind you, this was on yet another machine. The code is designed to react to downloaded computer data, reformatting cells as the computer belches out data. Does your your crystal ball reveal any hints as to the source of this curse? thx, Tom |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|