Changing a Drive letter for a Data Query. Excel 2003.

WizzRog

New Member
Joined
Oct 12, 2005
Messages
5
Hi all - I was wondering if you might help save my fingers with excessive typing.

I have a workbook of 52 Worksheets - each sheet is reading a data source from an MS-Access database (all from the same MDB). Currently the sheet is reading from C:\ but I would like to post the file onto a network drive (along with the MDB it reads from).

I need to change the drive mapping of each of the 52 queries from C:\ to M:\

I can do this manually, via Edit Query - and going to Microsoft Query, using the SQL button to change the drive mapping. I have done about 4 and it's very time consuming.

Any help would be greatly appreciated.

Thanks
Rog
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
You can write a macro with the following code:

Code:
chDrive "M"

This changes the default drive that excel looks at for Save and Open commands (and I assume QL queries too).

You can either place this code in an event or you can link it to a button or a keyboard short-cut, depending on how you want to trigger it.
 
Upvote 0

Forum statistics

Threads
1,202,913
Messages
6,052,530
Members
444,589
Latest member
Ben AFF

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