ColorIndex property stopped working

  • Thread starter Thread starter Gary Burton
  • Start date Start date
G

Gary Burton

I am using Excel 2002. I have an extensive VBA application that has been working for years in several Windows systems. I am now getting an error, that I can't explain. It occurs under both WinXP (my desktop) and WinME (my laptop) in the same application. It may also occur under other O/S's, but those are the only ones I am using right now. Since it occurs on 2 different computers with 2 different O/S's and 2 different Excel installations, it must be a problem with the application itself.

When I run a line in my code such as:
Range("ServoForcerWeight").Font.ColorIndex = 1, or any of many such statements that use the ColorIndex property (and used to work), I get the following

Runtime Error 1004: "Unable to set the ColorIndex property of the Font Class."

I have no idea how I broke my system. The help file isn't much help, and I couldn't find an answer on the MSKB -- or through Google. I think I need an expert.

Please help.
 
I read all of those that could possibly apply and none of them did.
Thanks anyway.

I discovered that my particular problem is caused by the fact that I am
working with a protected workbook. I apparently used to unprotect the sheet
while the code was running, then protect it again when I finished. I must
have removed that code, and didn't remember it. Therefore, the ColorIndex
command was trying to make a change in a protected sheet.

It bothers me that I can't remember making the changes that caused the
problem, but that must be what happened. I guess my problem is solved.


Gord Dibben said:
Gary

Wander through these google search results. You might find something that
will help.

http://snipurl.com/4b5h

Gord Dibben Excel MVP

been working for years in several Windows systems. I am now getting an
error, that I can't explain. It occurs under both WinXP (my desktop) and
WinME (my laptop) in the same application. It may also occur under other
O/S's, but those are the only ones I am using right now. Since it occurs on
2 different computers with 2 different O/S's and 2 different Excel
installations, it must be a problem with the application itself.statements that use the ColorIndex property (and used to work), I get the
followingand I couldn't find an answer on the MSKB -- or through Google. I think I
need an expert.
 
Back
Top