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
Show the SQL dialog with my SQL text (Read 4920 times)
Gerrit-Jan Linker
YaBB Administrator

Posts: 75
Show the SQL dialog with my SQL text
17.11.05 at 11:25:23
User Devaki asked the following question today.
Can I show SQL*XL's SQL dialog through VBA and pass my SQL text to it?
SQL*XL's API does not contain syntax to control its front-end. However if there is demand for this it is relatively easy to add to the API. I have posted the following item in the feature wish list:
I can provide a workaround for now. Use this code to achieve what you require. There is a subroutine for each menu item in the SQL*XL menu.  The sub mnuSQLDialog_Show is called when the SQL item is selected in the SQL*XL toolbar. To make SQL*XL display your SQL text you can use this workaround. SQL*XL remembers the last SQL text that was executed in a variable. You can put your SQL text into this variable so it will be shown instead. Note that you should only select 1 cell when showing the SQL dialog and that the selected cell should not contain a comment.
Sub Macro1()
  SQLXL.Prev_SQL = "hello world"
End Sub

Back to top

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