SkipVought
Programmer
I want to be able to run 2 dozen+ Excel queries from a Word document by clicking on a hyperlink or a button, the resultset to be displayed in a spreadsheet.
I have designed a pilot that functions as follows:
1. Word opens - in the Document_Open event, I start an Excel Workbook that has a GetData procedure that takes an argument that is the SQL and write the resultset to a worksheet.
2. From within Word, I select a hyperlink that opens a specific workbook with a Workbook_Open event code that calls GetData(ThisSQL). As a result, the query is run and the resultset displayed in the active workbook.
The problem with my design is that I have 2 dozen different queries and consequently as many separate workbooks, each one with unique SQL stored in a single cell. The VBA code is identical.
What other approaches would you suggest?
Thanx y'all
Skip,
metzgsk@voughtaircraft.com
I have designed a pilot that functions as follows:
1. Word opens - in the Document_Open event, I start an Excel Workbook that has a GetData procedure that takes an argument that is the SQL and write the resultset to a worksheet.
2. From within Word, I select a hyperlink that opens a specific workbook with a Workbook_Open event code that calls GetData(ThisSQL). As a result, the query is run and the resultset displayed in the active workbook.
The problem with my design is that I have 2 dozen different queries and consequently as many separate workbooks, each one with unique SQL stored in a single cell. The VBA code is identical.
What other approaches would you suggest?
Thanx y'all
Skip,
metzgsk@voughtaircraft.com