I am trying to make an Excel file that will pull from a SQL database and provide the front end user with the desired information. Now excel will do lots of calculations after it has pulled the data over which I have that working just fine. My problem is that everything works great for me on my computer but the second I e-mail it to someone it no longer works because they do not have the same OLEDBConnection as I do. So is there a way for me to create that connection for them. Below is the sample code I have which was just recorded as I did the process.

Please Login or Register  to view this content.
I had thought of trying to write a macro that just adds the connection before it does the Get External Data but the Create connection does not allow for connection to multiple tables where as Get External Data does.

I have now tried copying my connection file to their PC, saving the connection file on the network drive, as well as splitting the data from the two tables I need and pulling them in one table at a time and using VBA to make the connection and all of these have meant with no success.

As this is SQL based as well I did first post this question on StackOverflow at the link.

http://stackoverflow.com/questions/2...iple-computers