paul_taylor
New Member
- Joined
- Feb 15, 2011
- Messages
- 33
Two issues:
I'm pulling data from SQL server into Excel. That table is referred to throughout the workbook using Excel 2007 table structure. I created the table by manually accessing SQL server through Data > From Other sources > From SQL Server. The default is for Excel to convert the results into Excel 2007 table structure, which is good.
1. I'd like to refresh this connection through a macro, passing the username and password, so the user doesn't have to do this. Can this be done? I know how to do this as an ODBC query, but not through the native SQL server connection used to create the table.
2. I can create the table and refresh, using VBA macro, just fine if I do it as an ODBC query. BUT, the results are not formatted as an Excel 2007 table, and it's impossible to convert the resulting dataset into a table. Can I use ODBC and convert to table?
Either of these two would suffice.
I'm pulling data from SQL server into Excel. That table is referred to throughout the workbook using Excel 2007 table structure. I created the table by manually accessing SQL server through Data > From Other sources > From SQL Server. The default is for Excel to convert the results into Excel 2007 table structure, which is good.
1. I'd like to refresh this connection through a macro, passing the username and password, so the user doesn't have to do this. Can this be done? I know how to do this as an ODBC query, but not through the native SQL server connection used to create the table.
2. I can create the table and refresh, using VBA macro, just fine if I do it as an ODBC query. BUT, the results are not formatted as an Excel 2007 table, and it's impossible to convert the resulting dataset into a table. Can I use ODBC and convert to table?
Either of these two would suffice.