Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Changing Excel Worksheet Names To Ensure Continuity

$
0
0

Hello, everyone!

I had an SSIS package that would import the contents of a single sheet Excel file, massage the data and dump the results into a SQL table.

I used an Excel Source tool to set up the template, and it has a set value for the name of the specific worksheet to access. This worked fine for my original source files - every Excel workbook had the working sheet named, "Report." But, I need to adapt this package to work with Excel workbooks from another vendor and, rather than a fixed name for the relevant worksheet, they use a combination of the month and day; so, "02.09" for Feb 9th, rather than, "Report."

This means that as I receive the daily report, the worksheet name changes thus, "02.09," "02.10," "02.11," etc. But, I need the name to remain constant so that the template can be used.

Now, I know it's possible to change the worksheet names using vBasic in a macro from within Excel, but is there a way to do it from outside? I'm thinking that I could run a script task to modify the worksheet names for each daily report before importing them for massaging, but I don't know how to do it, if that's even possible from outside Excel.

Or - and, this'd be nice - is there some sort of mechanism in SSIS to change the worksheet names? Or - this'd be even better as it would save a few steps - is it possible for SSIS to use a dynamic name for the worksheet in the Excel Source Editor?

Any ideas?


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>