+ Reply to Thread
Results 1 to 15 of 15

Macro to open a file on Dropbox from any computer

  1. #1
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Question Macro to open a file on Dropbox from any computer

    Hi guys,

    I have the following macro:
    Please Login or Register  to view this content.
    Each computer in our company has a different user name... In my case, my username is NSW02 and the macro works well...
    But if another user, in another computer, for example NSW01, if he try to open the file it doesn't work because of the location of the file (because of the username).

    I had a look in the forum and I found the link below. This guy had ALMOST the same problem, but it didn't work for me. Message error is "File not found".
    http://www.excelforum.com/excel-prog...-computer.html


    Any idea?

    Thanks guys
    Last edited by ricdamiani; 08-30-2013 at 01:58 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Macro to open a file on Dropbox from any computer

    Look at replacing the UserName with Environ("UserName") in your code.

    to test your user name. type this in the Immediate Window of the VBE ?Environ("UserName")
    Last edited by alansidman; 08-29-2013 at 11:41 PM.
    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
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Macro to open a file on Dropbox from any computer

    Quote Originally Posted by alansidman View Post
    Look at replacing the UserName with Environ("UserName") in your code.

    to test your user name. type this in the Immediate Window of the VBE ?Environ("UserName")
    Hi Alansidman,
    Thank you for your reply.

    Could you please explain it a little bit more?
    I try to replace the my username with Environ("UserName") and didn't work.

    Cheers

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to open a file on Dropbox from any computer

    Hello Rick,

    Try this...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Macro to open a file on Dropbox from any computer

    Quote Originally Posted by Leith Ross View Post
    Hello Rick,

    Try this...
    Please Login or Register  to view this content.
    Hi Leith Ross,
    Thank you for your reply.

    It is opening the adobe, but not the pdf life.
    Any idea why?

    Half way it's done

    Thank you!

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to open a file on Dropbox from any computer

    Hello Rick,

    It could be the the file path needs to include the quotes. Try this...
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Macro to open a file on Dropbox from any computer

    Hi Leith,

    Still didn't work.
    It finds the Adobe but cannot find the file... the location is correct...


  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to open a file on Dropbox from any computer

    Hello Rick,

    Time to pull out the big guns. This API call is for Windows 7 And later. Delete your old code and replace it with this...
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Macro to open a file on Dropbox from any computer

    Quote Originally Posted by Leith Ross View Post
    Hello Rick,

    Time to pull out the big guns. This API call is for Windows 7 And later. Delete your old code and replace it with this...
    Please Login or Register  to view this content.
    LOL Leith... The big gun didn't work

    When I run the stuff above the macro (the API??), it opens another stuff to run the macros

    And if I run the macros, nothing happen... Not even the Adobe opens..

    Btw, I am using Windows 7

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to open a file on Dropbox from any computer

    Hello Rick,m

    Can you post your workbook for review? The macro works on my system to open any pdf file I choose and I am running Windows 7 also.

  11. #11
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Macro to open a file on Dropbox from any computer

    Quote Originally Posted by Leith Ross View Post
    Hello Rick,m

    Can you post your workbook for review? The macro works on my system to open any pdf file I choose and I am running Windows 7 also.
    Here it goes
    Autoprice sample.xlsm

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to open a file on Dropbox from any computer

    Hello Rick,

    Okay, that was my fault. The API call does not need to know where Acrobat Reader is since the file extension "pdf" is associated with the program. This version should work provided you have a file name in cell "V16", which I did not see in the posted workbook.
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 08-30-2013 at 01:39 AM.

  13. #13
    Forum Contributor
    Join Date
    07-28-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    298

    Re: Macro to open a file on Dropbox from any computer

    It is working now!!!
    Thank you

  14. #14
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to open a file on Dropbox from any computer

    Hello Rick,

    You're welcome.

  15. #15
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Macro to open a file on Dropbox from any computer

    @ Leith Ross,

    Hi Leith,

    As allways, very well done!

    It is just a pity though that is looks as if it wont work on Excel versions earlier than Windows 7.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

+ 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. Macro to open a file on dropbox from any computer
    By skip2mylew in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2013, 06:03 PM
  2. How to make macro automatically run once new file comes in on dropbox???
    By t_gagliardi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2012, 10:25 AM
  3. Replies: 3
    Last Post: 04-27-2006, 10:35 AM
  4. Open mdb file from another computer
    By stefantem in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-25-2006, 08:29 AM
  5. [SOLVED] How do I open an xls file if I don't have Excel on my computer?
    By M. klimo in forum Excel General
    Replies: 2
    Last Post: 11-04-2005, 09: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