ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   EXCEL VB Macro Run Time Error 1004 - Setting ColorIndex (https://www.excelbanter.com/excel-programming/294900-excel-vbulletin-macro-run-time-error-1004-setting-colorindex.html)

Erwin[_2_]

EXCEL VB Macro Run Time Error 1004 - Setting ColorIndex
 
A macro developed and running ok under Offixe/XP prodcues
Run time error 1004 "Unable to set Colour Index for
Interior Class" when the spreadsheet macro is run on a PC
running XP but EXCEL prior to Office XP. I have beleive
the problem VB statement a

Set Rng = ActiveSheet.Range("B6:U55")
Rng.Interior.ColorIndex = xlNone

A work around would be appreciated.

mudraker[_179_]

EXCEL VB Macro Run Time Error 1004 - Setting ColorIndex
 
Code works ok on my excel 9

--
Message posted from http://www.ExcelForum.com


Dave Peterson[_3_]

EXCEL VB Macro Run Time Error 1004 - Setting ColorIndex
 
When you say that other pc is running XP, is that winXP?

I'm guessing yes. If the version of excel prior to xl2002 is xl97, then it
could be a bug in xl97.

If you run a macro from a control on a worksheet from the controltoolbox
toolbar, you can either toggle the .takefocusonclick to false for that control
or add:

activecell.activate

to the top of your code.

If that prior version wasn't xl97, then ignore this message.



Erwin wrote:

A macro developed and running ok under Offixe/XP prodcues
Run time error 1004 "Unable to set Colour Index for
Interior Class" when the spreadsheet macro is run on a PC
running XP but EXCEL prior to Office XP. I have beleive
the problem VB statement a

Set Rng = ActiveSheet.Range("B6:U55")
Rng.Interior.ColorIndex = xlNone

A work around would be appreciated.


--

Dave Peterson


Tom Ogilvy

EXCEL VB Macro Run Time Error 1004 - Setting ColorIndex
 
Is the sheet protected. No reason it shouldn't work on an unprotected
sheet.

--
Regards,
Tom Ogilvy

"Erwin" wrote in message
...
A macro developed and running ok under Offixe/XP prodcues
Run time error 1004 "Unable to set Colour Index for
Interior Class" when the spreadsheet macro is run on a PC
running XP but EXCEL prior to Office XP. I have beleive
the problem VB statement a

Set Rng = ActiveSheet.Range("B6:U55")
Rng.Interior.ColorIndex = xlNone

A work around would be appreciated.




ross

EXCEL VB Macro Run Time Error 1004 - Setting ColorIndex
 
If the colour index is changed somewhere in the code , i.e it value is
cahnges, bit maybe that the value is too large, or small, excel, 97,
has a range for charts of 0-60, i think!
good luck
ross


All times are GMT +1. The time now is 06:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com