Them main issue is
Opening a rowset for "New_Val$A3:C10000" failed. Check that the object exists in the database
it is not related to the Destination, it looks like the New_Val$
sheet is not found in all worksheets
You can add script task before the DataFlow Task to retrieve the first sheet name, a similar logic to the following:
using System;
using System.Data;
using System.Data.OleDb;
using Microsoft.SqlServer.Dts.Runtime;
public class ScriptMain
{
public void Main()
{
string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\\myFolder\\excelfile.xlsx;Extended Properties=\"Excel 8.0;HDR=YES\";";
using (OleDbConnection conn = new OleDbConnection(connectionString))
{
conn.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
// Get all Sheets in Excel File
DataTable dtSheet = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
DataRow dr= dtSheet .Rows[0];
string sheetName = dr["TABLE_NAME"].ToString();
// You have to assign value to variable (assuming sheetName is created in SSIS)
Dts.Variables["sheetName"].Value = sheetName ;
}
cmd = null;
conn.Close();
}
}
In the Excel Source read the sheet name from a variable , from an SQL command that use this variable from an expression
Note that all worksheets must have the same structure, else it will never succeed