Mircosoft Query

brettvba

MrExcel MVP
Joined
Feb 18, 2002
Messages
1,030
If the Data gets refreshed at the start of a macro for Excel does the macro wait for the data to be refreshed before continuing??
 
Can i see the code i use ODBC via VBA every day many times a day this should not happen??

Excel ODBC is ripping from what ?? crystal (should self contain) or some bespoke system

ill look at the code if you like,,,

5 mins ODBC is not long for 5 sheets so code and links is good...

theres little secret in VBA codes so should be ok to post ... un less passwords but once signed in to ODBC should stay in an no PW reqd... again that session, untill you log off the network that is..
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Jack im not using code to transfer the data I have set it up via Microsoft query and it refreshes like a pivot table so what i have found is that it has to be run like the below
Sheets("111stk").Select
Range("a2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("211stk").Select
Range("a2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("511stk").Select
Range("a2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("832stk").Select
Range("a2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("834stk").Select
Range("a2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("834stk").Select
Range("a2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False


and it waits for each one to run but the stupid thing is crashing now is there another way of tranfering the data I thought that way was a good way because I have to provide this program for about 10 others to use and I want it so that it doesn't need heaps of extra files , My IT dept doesn't like the Idea of a macro retriving data from the as400 system so I think that the mircosoft query is the only way to go appart from using a data transfer file which is a seperate file altogether

I basically just want to refresh the data on a specific sheet then perform some other bits and pieces with the data in the same macro.
 
Upvote 0

Forum statistics

Threads
1,215,086
Messages
6,123,033
Members
449,092
Latest member
ikke

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