+ Reply to Thread
Results 1 to 3 of 3

Excel Object -- opening/closing issue

  1. #1
    Registered User
    Join Date
    01-18-2019
    Location
    Kansas City, MO
    MS-Off Ver
    Office 2016
    Posts
    6

    Excel Object -- opening/closing issue

    I have a cash flow forecaster, that has given me some sort of issue and spottily works for months now. I am by no means the level of VBA programmer as a lot of people on here, so the fact that this thing has bugged me for this long might be an easy fix for folks on here.

    What this forecaster does is:

    Takes a look at bunch of our excel files, and generates an A/R from it. It also generates an A/P from it. It also takes a look at our shipment schedule, and creates a future A/P from it. As an addition it has an internal tracker of customer's payment history, and adjusts our projected A/R accordingly. Pretty simple task when I write it like that...

    After tweaking tweaking tweaking, I have it *almost* working. I am attaching the excerpt, somewhere within which there is a problem.

    The excerpt does as follows:

    1) First, fetches workbooks from a list of paths
    2) Records all names that are going to appear in the A/R
    3) Closes each workbook
    4) Again opens up each workbook
    5) Keeps a track of average days late/early in payments seen in each workbook, and also Records the AR and AP
    6) And lastly, it doesn't work

    I am fully aware of the inefficiencies of opening/closing the workbooks only to reopen them, but there is reasoning behind that which I won't get into for interest of brevity.

    Basically, the problem is that... some workbooks are not closing. They stay open, it feels like xlbook.close is not firing. It is also messing up the AR and AP somehow. The code used for AR and AP is exactly as I have written it in separate, working, modules.

    My best guess is the problem lies somewhere in the:
    Please Login or Register  to view this content.
    i

    I am sure there may be fix that is outside the realm of my simplistic understanding of objects in Excel

    Let me know!
    Attached Files Attached Files
    Last edited by alansidman; 06-07-2019 at 05:19 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,669

    Re: Excel Object -- opening/closing issue

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    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

  3. #3
    Registered User
    Join Date
    01-18-2019
    Location
    Kansas City, MO
    MS-Off Ver
    Office 2016
    Posts
    6

    Re: Excel Object -- opening/closing issue

    Understood. Thanks, Alan

+ 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. calculate difference in opening and closing only when closing decreases
    By juriemagic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2019, 04:07 AM
  2. [SOLVED] Opening another excel file then closing it?
    By OpOrange in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2015, 01:14 AM
  3. Need assistance with Opening and closing Excel-document
    By RinorM in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-28-2014, 02:01 AM
  4. Opening, Closing, and Opening Excel workbooks from MS Project
    By m007schneider in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2013, 03:22 PM
  5. Issue with order of opperations (opening/closing source file)
    By vchibisov in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-17-2013, 02:22 PM
  6. Closing and re-opening the same file in excel
    By thompsy121 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 10-19-2008, 09:11 AM
  7. Opening/closing Excel
    By Bart van der Ve in forum Excel General
    Replies: 0
    Last Post: 06-12-2007, 12:18 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