VBA With SQl Quereis : I work in a FMCG company, I work in data department almost with reports
so i on daily basis have to refresh a SQL query to get the updated data of yesterday's sales and transactions on excel environment
So now i have an idea, Why do not i design a report that can be automatically updated from sql ?
I mean what i do now is that i run the SQL query to get data and then from this row data i get useful info. by inserting data into pivot tables then linking my reports to this data via Vlookup for example
So is there a VBA Code that i can put in the report workbook that goes to the sql server or even the sql file and run the query then refreshs pivots and updates finally my report data,all this also i need it to be done on the background ?!
Example:
Now i have an excel workbook report wich is a table..that table is linked to another excel workbook by Vlookup which is the SQL query powerpivot
now i need code that can autorefresh the sql query pivot automatically in the background once i open the report's workbook and then gets the updated data into the the report table and refresh any pivot in the same report workbook
can anyone help?

Thanks
Regards
A.Sabry
