+ Reply to Thread
Results 1 to 14 of 14

compile error: invalid outside procedure

  1. #1
    Registered User
    Join Date
    09-30-2020
    Location
    Canada
    MS-Off Ver
    ..
    Posts
    10

    compile error: invalid outside procedure

    Hi guys,

    I'm new to vba and I get this error when I try to process my codes: compile error: invalid outside procedure
    Please Login or Register  to view this content.
    Thank you
    Last edited by 6StringJazzer; 05-18-2023 at 10:17 PM. Reason: please use code tags

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: compile error: invalid outside procedure

    Is the macro code located in the same workbook as Sheet3 ?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    09-30-2020
    Location
    Canada
    MS-Off Ver
    ..
    Posts
    10

    Re: compile error: invalid outside procedure

    Yes it is !

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: compile error: invalid outside procedure

    What makes you think that routine is the cause?
    Rory

  5. #5
    Registered User
    Join Date
    09-30-2020
    Location
    Canada
    MS-Off Ver
    ..
    Posts
    10

    Re: compile error: invalid outside procedure

    The ''Sub Question5()'' is highlighted after the error pops up.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: compile error: invalid outside procedure

    The code syntax itself is fine. Is there any other code in the module?

  7. #7
    Registered User
    Join Date
    09-30-2020
    Location
    Canada
    MS-Off Ver
    ..
    Posts
    10

    Re: compile error: invalid outside procedure

    Please Login or Register  to view this content.
    Here you go! thank you for your help
    Last edited by 6StringJazzer; 05-18-2023 at 10:17 PM. Reason: please use code tags

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: compile error: invalid outside procedure

    Please use code tags when posting code.

    There's nothing wrong with that code either. Perhaps you could post the workbook? (you can remove any data)

  9. #9
    Registered User
    Join Date
    09-30-2020
    Location
    Canada
    MS-Off Ver
    ..
    Posts
    10

    Re: compile error: invalid outside procedure

    By the workbook, you mean the excel file ?

  10. #10
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: compile error: invalid outside procedure

    Yes, please.

  11. #11
    Registered User
    Join Date
    09-30-2020
    Location
    Canada
    MS-Off Ver
    ..
    Posts
    10

    Re: compile error: invalid outside procedure

    Here it is.
    Attached Files Attached Files

  12. #12
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: compile error: invalid outside procedure

    Double click the Sheet1 object in the Project Explorer window and you will see that the number 4 has been typed in a blank module. Delete it.

  13. #13
    Registered User
    Join Date
    09-30-2020
    Location
    Canada
    MS-Off Ver
    ..
    Posts
    10

    Re: compile error: invalid outside procedure

    Wow thank you very much, have a good day!

  14. #14
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: compile error: invalid outside procedure

    Glad to help.

+ 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. Compile Error: Invalid outside procedure
    By ANewCoder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2019, 04:31 PM
  2. Compile Error : Invalid outside procedure is popped
    By stephen.sabs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-11-2019, 05:32 AM
  3. Compile Error: Invalid Outside Procedure Error
    By pschris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2015, 01:51 PM
  4. “Compile error: Invalid Outside Procedure”
    By Rajeshkumar R in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-26-2013, 04:32 AM
  5. [SOLVED] Compile Error: Invalid Outside Procedure
    By packet25 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-13-2013, 07:02 AM
  6. invalid outside procedure error
    By trum01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2009, 07:20 AM
  7. Compile Error: Invalid outside procedure
    By smylod in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-27-2009, 01:56 PM

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