+ Reply to Thread
Results 1 to 3 of 3

Select/close the previously activated workbook

  1. #1
    Registered User
    Join Date
    01-11-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    96

    Select/close the previously activated workbook

    Hi Guys

    I have a tracker file that I use many times a day that copies data from a downloaded spreadsheet (Facility Tracking)using VBA. We are now using Microsoft edge. The trouble is, in Edge the file is still showing in the download list so the downloaded file name changes, I get a (1), then a (2) after the file name, which stops the import macro from working as it uses the standard file name, Facility Tracking, to close the file once the import is complete. I have tried using wildcard type things (Facility Tracking * for example) but this will close either file as the names are similar. is there a way of just selecting or activating the previously activated file so it can be closed? I have Googled it but couldn't find anything that worked for me. This never used to be a problem with Internet Explorer and we don't have Chrome installed on the work computers

    Thanks for looking
    Attached Files Attached Files
    Cheers

    Ross

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,222

    Re: Select/close the previously activated workbook

    The whole thing should be written quite differently. But, to change as little as possible at the moment, you can apply your own function which will try to search for the relevant workbook.
    Only the CopyData procedure is changed plus the FindBookName function.
    Please Login or Register  to view this content.
    Artik

  3. #3
    Registered User
    Join Date
    01-11-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Select/close the previously activated workbook

    Hi Artik

    I know my macro writing skills aren't great but I have figured a lot out myself over the years and tend to make do with what works. Never had the time to learn it properly. Anyway, your fix works perfectly, many thanks for your help, much appreciated

    Cheers

    Ross

+ 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. Copy from first workbook, close open new workbook paste close
    By johncarr1952 in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 08-04-2021, 08:50 AM
  2. run code as workbook gets activated
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2017, 03:01 AM
  3. VB to: Open workbook, adjust column widths of select sheets, save, close
    By JPSIMMON in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-10-2017, 12:08 PM
  4. VBA : Workbook which is open Already is not getting activated
    By Gurushankar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-08-2011, 01:30 PM
  5. Macro to close down word and re-open a previously saved document
    By snoopy1461 in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2011, 09:59 AM
  6. Macro to select the first unlocked visible cell when a sheet is activated
    By gazza365 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2011, 02:01 AM
  7. Close previously opened worksheet
    By Soltisolti in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-10-2007, 12:40 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