Results 1 to 6 of 6

"Object required" error upon "Exit Function" statement

Threaded View

6StringJazzer "Object required" error upon... 12-24-2018, 01:30 PM
shg Re: "Object required" error... 12-24-2018, 03:31 PM
shg Re: "Object required" error... 12-24-2018, 03:35 PM
mjr veverka Re: "Object required" error... 12-24-2018, 04:13 PM
shg Re: "Object required" error... 12-24-2018, 04:54 PM
6StringJazzer Re: "Object required" error... 12-24-2018, 06:40 PM
  1. #1
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner VA USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,569

    "Object required" error upon "Exit Function" statement

    I have an OpenProject function in Excel VBA that returns an Object. The purpose is to open a Microsoft Project file and return the Project as an object. The code is being written to be able to run in either Excel or Project. The OpenProject function opens the project correctly and correctly assigns it to the return value for the function. When I debug after the project is opened, I am able to use commands in the Immediate window to get the name of the project and number of tasks, so I know the object is valid.

    However, when the Exit Function statement is executed I get an "Object required" error. I have seen this error occur on various statements but never on an Exit Function statement when the return object is valid. What could possibly cause this on Exit Function?

    I have attached a file that has been skinnied down to the minimal code to reproduce the error.
    Attached Files Attached Files
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] "ActiveWorkbook.Path" fails - triggers "Compile Error Object required"
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-15-2018, 02:58 PM
  2. Replies: 35
    Last Post: 01-13-2016, 02:16 AM
  3. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 AM
  4. "The "sheets" method from the "_Global" object have failed."
    By mankit87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2011, 08:53 AM
  5. Error msgs: "Object varible or with block variable not set"; "subscript out of range"
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 04:58 PM
  6. Replies: 3
    Last Post: 12-14-2006, 01:36 PM
  7. What is Error "Method "Paste" of object "_Worksheet" failed?
    By vat in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-17-2006, 04:10 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