Linker IT Software
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Automating queries (Read 4012 times)
Gerrit-Jan Linker
YaBB Administrator

Posts: 75
Automating queries
05.10.05 at 11:16:11
To get this forum started I will post some questions I receive from customers.
what I am trying to do is build an excel application that opens
and displays the results of various queries on one excel sheet.
This is not soo difficult. The way to start is to write the queries. Then execute each of them separately to the location you want the results to be displayed in (which tab and cell to start the results). Then the easiest is to use the requery button to requery the whole workbook. SQL*XL will read the SQL from all the tabs and add a to clause to each statement such as:
     select * from emp to sheet1!A1;
     select * from dept to sheet1!P12;
Now the only thing to do is to record the refresh as a macro. Also record the connecting to the database and disconnecting from the database after you refreshed. The only thing to do next is to call the macro from the Workbook_Open event.
Back to top

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1