+ Reply to Thread
Results 1 to 5 of 5

Need help on work books not closing and data not copying and pasting over correctly

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2007
    Posts
    66

    Lightbulb Need help on work books not closing and data not copying and pasting over correctly

    Hi there,
    i am still teaching my self a lot of this but i am (very slowly) getting there.

    I have a few issues with my code.

    essentialy what the code does is,
    the user opens a file called "ae4", this file and its location is used to open all the necessary files.

    Data is copied and pasted from the newely opened files and all these files are then to close and the data is to copy into a main file that looks after the data.

    however 2 of the workbooks dont close even though my code asks them to and one piece of data that i find by first searching for a blank cell, then using offset to find the data next to the blank cell doesnt seem to copy over correctly, it carries some weird sum with it causing a circular issue.


    you can read in the comments in my code where the errors seem to happen.

    all help appreciated.

    Please Login or Register  to view this content.
    thanks again lads
    Dave
    Last edited by unreal_event_horizon; 12-21-2012 at 06:15 AM. Reason: left out helpful info

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Dave

    Why are you opening 4 workbooks right at the start?

    Why not open them one at a time, do what needs to done, eg copying etc, and then close them?

    When you do open them create a reference to them which you can use on the code and when you want to close them.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    08-03-2012
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2007
    Posts
    66

    Re: Need help on work books not closing and data not copying and pasting over correctly

    Thanks Norie,
    i guess i could do that, ill try it and see if i can spot where im going worng

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Dave

    This is kind of what I mean.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-03-2012
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2007
    Posts
    66

    Re: Need help on work books not closing and data not copying and pasting over correctly

    im not up to speed on that yet, but by seperating out my code it all seemed to work, then it doesnt. its weird, i ran i once, it worked, i ran it again and it failed to pick up 2 pieces of data again.

    its frustrating but ill stick at it,

    here is the two bits of code that seem to have intermittent results.

    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