+ Reply to Thread
Results 1 to 6 of 6

"Compile Error: Sub or Function Not Defined" Please help

  1. #1
    Registered User
    Join Date
    03-07-2012
    Location
    West Des Moines, IA
    MS-Off Ver
    Excel 2007
    Posts
    18

    "Compile Error: Sub or Function Not Defined" Please help

    I'm trying to use the following code to take information from a single worksheet in two different workbooks and "paste" the data into a worksheet in a master workbook. I keep getting the error "Compile Error: Sub or Function Not Defined" I have worked on it for 4 hours now and can't figure it out. Any one have an idea what I'm doing wrong?

    Please Login or Register  to view this content.
    Thanks!

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,657

    Re: "Compile Error: Sub or Function Not Defined" Please help

    Do you have a Sub named "CloseAll"? And where is it?
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    03-07-2012
    Location
    West Des Moines, IA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: "Compile Error: Sub or Function Not Defined" Please help

    There is a "CloseAll" near the bottom. Is that part incorrect?

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,657

    Re: "Compile Error: Sub or Function Not Defined" Please help

    For some reason, your Code box has no scroll bars so I can't see anything below the App..Screenupdating line. When I pasted your code and added an End Sub. The debugger highlighted the Call CloseAll line. Can you repost the code, please?
    Last edited by protonLeah; 03-21-2012 at 12:31 AM.

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: "Compile Error: Sub or Function Not Defined" Please help

    There is a "CloseAll" near the bottom. Is that part incorrect?
    But there must be a macro in a open workbook called "CloseAll" to be executed (run). There currently isn't, so that's why the error message is appearing (as protonLeah was alluding to).
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  6. #6
    Registered User
    Join Date
    03-07-2012
    Location
    West Des Moines, IA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: "Compile Error: Sub or Function Not Defined" Please help

    Thanks guys! I got the macro to run, but don't have the macro closing the other two files, which is actually ok, it not better.

    Here is my final code

    Please Login or Register  to view this content.

+ 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