Relative location to open word document

adamprocter

Board Regular
Joined
Apr 13, 2015
Messages
53
I have an excel document that opens and pastes stuff into a word document
This code works like a dream

Code:
Set wdDoc = .Documents.Open("C:\Users\Adam\Desktop\Sample_template.docx")

But i would like to be able to move the excel file and word to a dropbox folder and use on any PC

so I tried

Code:
Set wdDoc = .Documents.Open("\sample_template.docx")

Looked in C:\
Any ideas ?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I want to move the excel sheet to dropbox and so the location is no the same on each machine but the files in that folder are.

I am still unable to do this

\dropbox\the_excelfile
\dropbox\the_wordfile

There must be a way to specify the relative location over absolute ?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,884
Messages
6,127,564
Members
449,385
Latest member
KMGLarson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top