+ Reply to Thread
Results 1 to 3 of 3

Object required when closing a workbook

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,963

    Object required when closing a workbook

    My code is erroring on the "Wkb.Close False" line with an "Object Required" error, and I can't figure out why. This is my attempt to condense a lot of previous code, so I'm sure I've done soemthing wrong, but it's not jumping out at me. I'd sure appreciate some wisdom on this one.
    Please Login or Register  to view this content.


    ---------- Post added at 11:48 AM ---------- Previous post was at 11:03 AM ----------

    Well, I figured it out. Instead of
    Please Login or Register  to view this content.
    I put
    Please Login or Register  to view this content.
    . That did the trick!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Object required when closing a workbook

    jomili,

    The issue is that the variable Wkb is used to loop through the array of filenames. That makes it a string type variable and not a workbook object. To close the workbook, you'll need to use:
    Please Login or Register  to view this content.


    ---------- Post added at 10:50 AM ---------- Previous post was at 10:50 AM ----------

    Looks like I posted a hair too late! Glad you got a working solution
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,963

    Re: Object required when closing a workbook

    Better late than never. Thanks for helping.

+ 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