+ Reply to Thread
Results 1 to 9 of 9

Basic Marco Help

  1. #1
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Basic Marco Help

    Hello All,

    I have an odd issue. I have a basic macro which will not run.
    When running the below macro, I receive this error: Application-defined or object-defined error
    The sheet name is: ManagerReport (Manager Report)

    I recorded the macro, and it provided the below code, with the same issue. I don't know where to turn. Help Please!!
    <code>
    Please Login or Register  to view this content.
    Last edited by alansidman; 01-30-2015 at 04:34 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,502

    Re: Basic Marco Help

    Code looks ok. Suggest you post a sample workbook.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Basic Marco Help

    Thanks TMS - Hopefully you can identify the issue. You will see that I have buttons across the top of the page. Then the corresponding macros, which I cannot get to work! Thanks for your help.

    Excel Example Macro.xlsb

  4. #4
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    422

    Re: Basic Marco Help

    Typo - your code refers to 'ManagerReport' (no spaces) but the sheet name is 'Manager Report'.
    Last edited by mgs73; 01-30-2015 at 12:35 AM.

  5. #5
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Basic Marco Help

    I tried that, with the same results. I have the same issue. I have tried with and without spaces. I also recorded a macro to eliminate human error, and same error.

  6. #6
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    422

    Re: Basic Marco Help

    I see now... Even typing ? ActiveSheet.Name in the immediate window when Manager Report is active causes the same error. Call Stats also seems to have the same problem.

    I had the same problem recently, and if there is a solution I don't know what it is. Hopefully someone here can enlighten both of us!

    In the end, I started from scratch, copying and pasting from old to new - not fun...

  7. #7
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: Basic Marco Help

    At least I am not the only one! Thanks and hopefully someone will chime in.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,913

    Re: Basic Marco Help

    I just ran your code in the workbook you attached and it worked with no error or issues. Cannot replicate your problem.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,502

    Re: Basic Marco Help

    This is your code:

    Please Login or Register  to view this content.

    The code name for the worksheet is "ManagerReport". The sheet name for the worksheet is "Manager Report"

    So, using the sheet/tab name, you could have:

    Please Login or Register  to view this content.
    or, using the code name, just:

    Please Login or Register  to view this content.

    Note that, for the latter option, you would have to change the subroutine name from "Sub ManagerReport()" as Excel/VBA would get confused. It is not good practice to have subroutines with the same name as Excel/VBA objects, properties, variables or reserved words.


    Regards, TMS

+ 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. How to create a Marco to run same Marco run on everysheet.
    By chriskingkiller in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-09-2013, 02:53 AM
  2. Run marco of a source file in the source file via marco of a master patch file
    By freeman6479 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2012, 10:55 AM
  3. Who is this Marco?
    By arthurbr in forum The Water Cooler
    Replies: 16
    Last Post: 09-05-2010, 06:02 AM
  4. [SOLVED] Can I run Visual Basic procedure using Excel Visual Basic editor?
    By john.jacobs71 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-26-2005, 10:25 AM
  5. I need some help with a Marco
    By xgunda420x in forum Excel General
    Replies: 2
    Last Post: 08-02-2005, 08:43 AM

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