Run-Time Antics

Tom Morales

Board Regular
Joined
Feb 16, 2002
Messages
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.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Let me make a wild (But, I think accurate) guess.

You're using a Control CommandButton on a sheet, and the TakeFocusOnClick 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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,913
Members
448,532
Latest member
9Kimo3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top