+ Reply to Thread
Results 1 to 4 of 4

Help with Opening, copying data, & closing original file with VBA

  1. #1
    Registered User
    Join Date
    10-18-2014
    Location
    Montana, USA
    MS-Off Ver
    2007
    Posts
    2

    Help with Opening, copying data, & closing original file with VBA

    I am attempting to write a code that with prompt to open a user specified file, copy a selection of data, paste the data into another workbook, then close the file the data originated from. I've gotten most everything to work except I can't figure out how to re-active the file to close once the data has been pasted since the file name was selected from a prompt. Any help to finish this out would be appreciated. here is what I have so far.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 10-18-2014 at 06:51 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help with Opening, copying data, & closing original file with VBA

    There's no reason to "select" or "activate" in most cases. I'd do that like this:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-18-2014
    Location
    Montana, USA
    MS-Off Ver
    2007
    Posts
    2

    Re: Help with Opening, copying data, & closing original file with VBA

    Thanks JBeaucaire that works very well.

  4. #4
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help with Opening, copying data, & closing original file with VBA

    As it appears you've reached a conclusion, I've marked this thread SOLVED for you.
    FYI, this is done through the Thread Tools located above the first post in this thread. Thanks.

+ 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. Save a copy of current .xlsm file without closing the original
    By gezza07 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2013, 08:52 PM
  2. [SOLVED] Opening, refreshing data connections, saving and closing file with VBA
    By jtukes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2013, 03:31 PM
  3. Replies: 6
    Last Post: 02-15-2012, 07:52 AM
  4. Opening and closing a file in VB
    By tleaton in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-19-2011, 07:49 PM
  5. 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

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