+ Reply to Thread
Results 1 to 5 of 5

Just recorded Macro not working

  1. #1
    Forum Contributor
    Join Date
    10-16-2012
    Location
    Brooklyn
    MS-Off Ver
    Excel 2010 PC
    Posts
    137

    Just recorded Macro not working

    Hi,

    I'm having a problem where a macro is recorded to select a sheet, then a run-time error occurs when I run the macro.

    The Error is:

    Run-time error '32809':

    Application-defined or object-defined error

    The code is very simple:

    Please Login or Register  to view this content.
    There is a data sheet and the error occurs when selecting this sheet in the VBA code.

    Any idea why this is occurring? I'm stumped.

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Just recorded Macro not working

    Just some thoughts, none of them have to be what happened.
    The word select should have changed to upper case automatically so that is a concern.
    1) You don't have other code where you've declared a variable called sheets? Dim Sheets as Worksheet.
    2) The sheet is protected, might not make a difference but I'll throw that out there.
    3) You have a Mac and I wrote code for someone and it did some weird stuff that no one with Mac experience was able to explain or help with, so maybe record the Macro again and see what happens.
    4) You changed the name of the sheet.
    5) You moved the macro to another workbook thinking it would open up the sheet in the workbook it originated in.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Just recorded Macro not working

    Have a read here
    http://stackoverflow.com/questions/2...s-mostly-32809

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Just recorded Macro not working

    If the sheet didn't exist you would probably get the "subscript out of range" error. I am guessing it has something to do with MAC. You could always try something like this:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-16-2012
    Location
    Brooklyn
    MS-Off Ver
    Excel 2010 PC
    Posts
    137

    Re: Just recorded Macro not working

    Thanks stnkynts - I didn't even think to add an error clause.

    Also, jolivanes, very useful link.

    It turns out that duplicating the tab I was working on, deleting the old one, and renaming the duplicate removed this problem also. I think sometimes Excel is just weird.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Working Formula Entered in Recorded Macro doesn't work when run!
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-24-2014, 11:07 AM
  2. [SOLVED] Why is my Simple Recorded Macro not working?
    By andrew93hughes in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2013, 08:49 AM
  3. Replies: 0
    Last Post: 06-29-2011, 04:53 AM
  4. Recorded Macro not Working Properly
    By ilias in forum Excel General
    Replies: 1
    Last Post: 07-15-2010, 09:47 AM
  5. VB code request for a Working Recorded Macro
    By hsmeet in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-30-2007, 11:40 AM

Tags for this Thread

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