Open file from certain path :{Solved}:

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
We have 2 copies of a single file.
One is on :
Path2 = "C:\Documents and Settings\Primary User\Desktop\Toms Main\"
The other:
Path3 = "C:\Documents and Settings\MyDocuments\Daily\"

I need it to pick the proper path based on the computer it is on. Is this even possible?

If I need to give more details, let me know!

Michael :)
 
Michael

I don't understand what you mean.:eek:

What I'm trying to establish is whether or not the workbook with the code to open the other workbook is in the same directory as the workbook to be opened.

If it is then you might be able to use ThisWorkbook.Path to specify the path.
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Norie,
I am sorry, I used your code and it works. :) :)

I could not try it on both computers because one computer was down and I forgot to change "filename" to my actual files name.

The if statement was exactly what I needed.

Thank You,
Michael
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,255
Members
449,075
Latest member
staticfluids

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