Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Run-Time Antics

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Richland, Washington
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Richland, Washington
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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