I´m creating an ETL on visual studio, but when I export my data to a table on Excel, the columns seem a bit short. Is there a way to autofit the column width from visual studio? Thank you
Update 1
Here is the code as I copied it and also the error I get
You can achieve this using a
script task
that execute after theDataFlow Task
success. You have to addMicrosoft.Office.Interop.Excel
assembly to the script task references and use the following code: (used Vb.Net)Note: you have to add Microsoft.Office.Interop.Excel.dll file to the following directories (.Net Framework dll directory) C:\Windows\Microsoft.NET\Framework\v2.0.50727 and (sql server data tools dll directory) C:\Program Files\Microsoft SQL Server\100\DTS\Binn (using vs 2005 and sql 2008) and then add this dll as a reference in your script task