accessing file remotely VBA code

instanceoftime

Board Regular
Joined
Mar 23, 2011
Messages
103
I have my xls with code on my desktop.

The code needs to access a remote computer to open an excel file "items".

How is this done? I tried a Z: and the following:

Workbooks.Open Filename:="Z:\Fileserver\Admin1\Glen\101-061-909\Glen\price program\items.xls"

but says could not be found? Help me please
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Check that the path exists by recording a macro to open the file and compare.
 
Upvote 0
Check that the path exists by recording a macro to open the file and compare.

crap, good call .. I didn't do as you asked (not sure how to go about what you asked) but

the network drive was correct (and visible) so I opened it and made a shortcut of the file I was trying to open and checked the properties for the location.

Workbooks.Open Filename:="Z:\Fileserver\Admin1\Glen\101-061-909\Glen\price program\items.xls"

should have just been
Workbooks.Open Filename:="Z:\items.xls"

thanks
 
Upvote 0
Right click your Ribbon and Customize it. Check the box on right side for Developer. From it, you can record macros, play, edit, insert controls, etc.

Recording a macro can help you create routines where syntax is not known. As you code, you will find that recorded macros is just a start. It uses a lot of Select, Selection, and Activate. Most times, that is inefficient and not needed.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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