Attach a web query inside a file

laticsforlife

New Member
Joined
Jul 11, 2011
Messages
10
I have a spreadsheet saved on a work server (so has a strange drive letter or location)

and on the same server I have a saved web query that I have linked to the file so when it is opened it runds the query (by macro) and pulls the data.

But that means I cannot send the file out to the ouside world as the reference to the web query would not relate.

Is there a VBA way of actually having the web query inside of that particular file rather than saved seperately?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I think I've partially found an answer, but the layout is a bit harder to understand.

In my macro it says

ActiveSheet.QueryTables.Add(Connection:="FINDER;\\myserver\FF\tfflist.iqy"

and I think I need to replace the FINDER part with a url, but the syntax is beating me.

The webpage wont alter so any examples provided can simply use www.bing.com as an example.

Any help greatly appreciated.
 
Upvote 0
Create a web query with the macro recording running to generate the VBA code which will show you the necessary syntax.
 
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,920
Latest member
jaspers

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