How do I pass a very long and complicated (for me anyway) SQL query to a
querytable in Excel? I know I have to use .CommandText, but every time I try
and combine the elements of the query (which have been stored in a string
array), the SQL will display in Microsoft Query, but will not execute. I need
to do this as my User Interface asks the user to supply 3 parameters which
then need to be incorporated in the query so that the correct data is
returned to a worksheet.
I have tried separating the elements with a space - Chr(32) - and also the
sequence - Chr(13) & "" & Chr(10) - which I found elsewhere. I can supply the
query, but it is nearly 1900 characters long.
Thanks,
Steve
Bookmarks