+ Reply to Thread
Results 1 to 3 of 3

Excel 2003 Macro Error - Runtime error 1004

  1. #1
    Cow
    Guest

    Excel 2003 Macro Error - Runtime error 1004

    Hi there,

    I had an Excel Macro program which was running very well in Office 97. But
    after I had upgraded my Office 97 to Office 2003, I could not run part of the
    program. I got the following error when trying to run the macro"
    Run-time Error '1004' Unable to set the colorIndex property of the Font Class.

    I noticed that the worksheet is actually write-protected. and if I try to
    unprotect the worksheet and re-run the macro, it runs well...
    Could anybody help me in this. Thanks a zillion

  2. #2
    Bob Umlas
    Guest

    Re: Excel 2003 Macro Error - Runtime error 1004

    Office 2003 is more strict than earlier versions. You're going to have to
    unprotect the sheet in the code:
    Activesheet.unprotect
    Range("Whataver").Font.Colorindex = ....
    ActiveSheet.Protect

    If there's a password, include it in the unprotect/protect lines
    (Activesheet.unprotect "xyz")

    Bob Umlas
    Excel MVP

    "Cow" <[email protected]> wrote in message
    news:[email protected]...
    > Hi there,
    >
    > I had an Excel Macro program which was running very well in Office 97.

    But
    > after I had upgraded my Office 97 to Office 2003, I could not run part of

    the
    > program. I got the following error when trying to run the macro"
    > Run-time Error '1004' Unable to set the colorIndex property of the Font

    Class.
    >
    > I noticed that the worksheet is actually write-protected. and if I try to
    > unprotect the worksheet and re-run the macro, it runs well...
    > Could anybody help me in this. Thanks a zillion




  3. #3
    Dave Peterson
    Guest

    Re: Excel 2003 Macro Error - Runtime error 1004

    Maybe your macro should unprotect the worksheet, change the colors and then
    reprotect the worksheet.

    Cow wrote:
    >
    > Hi there,
    >
    > I had an Excel Macro program which was running very well in Office 97. But
    > after I had upgraded my Office 97 to Office 2003, I could not run part of the
    > program. I got the following error when trying to run the macro"
    > Run-time Error '1004' Unable to set the colorIndex property of the Font Class.
    >
    > I noticed that the worksheet is actually write-protected. and if I try to
    > unprotect the worksheet and re-run the macro, it runs well...
    > Could anybody help me in this. Thanks a zillion


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1