+ Reply to Thread
Results 1 to 7 of 7

Problem to select different workbooks on Excel 2016 Mac

  1. #1
    Registered User
    Join Date
    11-02-2014
    Location
    Marbella, Spain
    MS-Off Ver
    Excel Mac 2016
    Posts
    68

    Problem to select different workbooks on Excel 2016 Mac

    Hello all,

    I'm trying to call a macro that will open other file and do operations with other file, both files are in an external drive (MY PASSPORT), and it appears the message:
    “Run-time error ‘1004’ Sorry, we couldn’t find MY PASSPORT/PnT/Home/Expenses Control.xlsm. Is it possible it was moved, renamed or deleted?"

    Also I can open the file if it is in the iMac using /Users/martabritto/Documents/PnT/Home/Expenses Control.xlsm but if I try access from an external drive, I don't know how to use it.

    Also if I want alternatively select both files I can't. Before in the Excel 2011 I used the command: Windows("expenses control.xlsm").Activate

    Now it returns an error "Run-time error '9' Subscript out of range

    Thank you for helping.

    BR,
    Pedro

  2. #2
    Registered User
    Join Date
    08-27-2019
    Location
    Alabama, USA
    MS-Off Ver
    2016, 2010, 2007
    Posts
    37

    Re: Problem to select different workbooks on Excel 2016 Mac

    I'm not familiar with mac's but I will give it a try.

    Can you manually open the file in question (located on your passport external harddrive) and run the following code then tell us what output it gives you? It will give the full location in both the Intimidate window in the VBA editor and in a small popup form.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,134

    Re: Problem to select different workbooks on Excel 2016 Mac

    Run this code in a testing workbook.

    Please Login or Register  to view this content.
    Does the value returned match the file path that your code uses to open the file?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Registered User
    Join Date
    11-02-2014
    Location
    Marbella, Spain
    MS-Off Ver
    Excel Mac 2016
    Posts
    68

    Re: Problem to select different workbooks on Excel 2016 Mac

    Hi Spencer,

    Thank you a lot for your input. FANTASTIC. At least I know already how to call external drives, as it appears: /Volumes/MY PASSPORT/PnT/Home/Expenses Control.xlsm.

    So the key is to put before: "/Volumes/"

    But please now if I want to copy from one file to the other how do i call both alternatively?

    Before there was the command Window("name file").Select
    Now that does not work

    Thank you once again
    Last edited by coolx72; 10-13-2019 at 09:59 AM.

  5. #5
    Registered User
    Join Date
    11-02-2014
    Location
    Marbella, Spain
    MS-Off Ver
    Excel Mac 2016
    Posts
    68

    Re: Problem to select different workbooks on Excel 2016 Mac

    Hi Mike,
    Thank you very much. GREAT !
    The same I mentioned to Spencer I say to you. The result it's the same as Spencer solution.

    But please now if I want to copy from one file to the other how do i call both alternatively?

    Before there was the command Window("name file").Select
    Now that does not work

    Thank you once again for your help.

  6. #6
    Registered User
    Join Date
    08-27-2019
    Location
    Alabama, USA
    MS-Off Ver
    2016, 2010, 2007
    Posts
    37

    Re: Problem to select different workbooks on Excel 2016 Mac

    I think what you're looking for is the following:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-02-2014
    Location
    Marbella, Spain
    MS-Off Ver
    Excel Mac 2016
    Posts
    68

    Re: Problem to select different workbooks on Excel 2016 Mac

    Hi Spencer and thanks again,

    In fact, I didn't try the String programming, but the command Workbooks("name of file").Activate, it was just what I was looking for.

    Thank you so much once again.


+ 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