accessing file remotely VBA code

instanceoftime

Board Regular
Joined
Mar 23, 2011
Messages
102
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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
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,214,827
Messages
6,121,812
Members
449,048
Latest member
greyangel23

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