Hi,

I have a strange problem with Excel VBA. I have programmed a spreadsheet to pull custom queries from various Access databases. I used the data connection wizard to go through MS Query to obtain the code to import database query VBA output. The problem is that the source parameter does not let me use a variant which is populated by a getopenfilename command. Like for instance, if I have the user select a file in a folder where the spreadsheet is not, it will come up with the dialogue box wanting you to choose the path. So if I had the VBA input the string to a variant called FileA, the command box looking for the path will display the path as "FileA". I am not using quotes around the variant where the Source:= parameter is located, as that would be in the form of a path, such as "C:\...". I am at a loss to explain how I can make the import database code allow me to specify the variant which will supply the string for the path. Any ideas????