![]() |
#1
|
|||
|
|||
![]()
Good afternoon!
I have created a series of macros for work that I use to analyze data. I would like to use these Macros on my home computers and my students would like to use them for analysis as well. The problem is I am getting frustrated with having to go into my Macros and always change: C:/Users/Danny/Desktop/ to C:/Users/Tina/Desktop/ to C:/Users/Becky/Desktop/ etc. How can I tell the macro C:/Users/ "ANYWHERE" /Deskop/? Thanks! Bryan PS - I am self-taught in programming so I don't have a large "tool box". |
#2
|
||||
|
||||
![]()
Hi Bryan,
Depending on what you're doing, it may be as simple as changing the hard-coded file path to: ActiveDocument.Path If that doesn't work, you really need to give more details of the code and where the document has been saved to when the macro is run.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Thank you Paul! But like I said, I'm fairly weak in VBA and coding... what is the "english translation" of ActiveDocument.Path? I'll look that command up in a dictionary too!
What I was doing was taking a text file off of C:/.../Desktop, importing it, then moving the text file to C:/.../Documents/ and exporting a picture to the desktop at the same time. This works for things like that? |
#4
|
||||
|
||||
![]()
Hi Bryan,
Quote:
ActiveDocument.Path will typically return a string like: C:/Users/Bryan/My Documents so, if you wanted: C:/Users/Bryan/Desktop you could use the vba Replace command to change 'My Documents' to 'Desktop', and the ActiveDocument.Path expression combined with the Replace command would then work equally well for: C:/Users/Danny/Desktop; C:/Users/Tina/Desktop; and C:/Users/Becky/Desktop, etc.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Aquanut | Outlook | 8 | 02-02-2011 09:54 AM |
outlook on two home computers | dan.myers2229 | Outlook | 2 | 09-25-2010 04:10 PM |
![]() |
Bob Newton | Outlook | 2 | 08-20-2010 03:34 PM |
![]() |
silverbullett | Office | 2 | 08-19-2009 08:47 AM |
Syncing references across multiple computers | bremenick | Word | 0 | 07-23-2009 10:12 AM |