.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Import List of Worksheet Names from Multiple Sheets Excel File

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :Sql Server
I am only interested in OPENROWSET/OPENQUERY or xp_cmdshell solutions. Thanks.
Kalman Toth, SQL Server & Business Intelligence Training; SQL 2008 GRAND SLAM

View Complete Post

More Related Resource Links

How to merge sheets from multiple excel files into one .xls file?


 I have several excel spreadsheet fils, each of them contains multiple work sheets that may storing images or data.

 How could I merge all of these work sheets to just one .xls file and keep their original layout and style using asp.net?

 Thanks in advance.

Import list from excel file



I try import a table from excel file to become a SharePoint list.

I want the first column in the excel to become the title column (linked to item).

I did some tests and in each tests it tooks a different column of the excel to be the sharepoint column which is "linked to item with edit menu".

What is the logic and how may i control which excel column will be that sharepoint column?


Import Excel spreadsheet To Sharepoint List

Hi, I am having sharepoint 2010 RTM trial on Windows Server 2008 SP2. I want to populate csv filke data to new sharepoint list. I am using custom List Wizard to achieve this... When I Import csv on server then everything is fine but when i inport csv from client, i get the following error "The Specified is not valid Spreadsheet or contains no data to import" I have also checked to import excel workbook but it gives the same error on client and do great on server..... can anybody have any idea what is wrong ?? thanks

how do i develop a cascade drop down lists which get the chart names from excel sheets

hi i have to develop a cascade dropdownlist. one of the drop down is used to retrive only excel docs from a specific doc library and and the other drop down to get all the chart names and attach it to the second dropdown list in doc lib item changed event thanks    

ssis 2008 Loading MULTIPLE EXCEL file

HI it is possible for me to load multiple text file using for each loop,but if i try the same process for EXCEL file then my excel source throws an error. Also when i created my variable in value  i have given the path of my excel file ,still it didnt help me..because the moment i map the variable with the connection string of source excel connnection(property->expression->connection string) it start giving error if you could help me or provide some reference it will be of great help http://bi-polar23.blogspot.com/2007/08/loading-multiple-excel-files-with-ssis.html i tried this link but got stuck with it on step 12 and 14 (below  is my connection string) and variable is @Filename which i have created Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\mushtaq.sheikh\Desktop\ForEach\New Microsoft Excel Worksheet1.xlsx;Extended Properties="Excel 12.0;HDR=YES"; The moment i try to edit my connection string by comparing connection string provided in link it gives error(an OLEBD error has occured with error code 0x80040E73) on excel source Thanks in advance

import multiple Excel 2007 files using openrowset

hello, I Have a folder that includes multiple excle files (ver 2007), i am trying  to loop through each file using vbscript to import its data to sql 2000 using openrowset but i am getting this error in the openrowset line "[Microsoft][ODBC sql server driver] [sql server] [OLE/DB provider returned message: the microsoft office access DB engine cannot open or write to the file '', it is already open exclusively by another user or you need permission to view or write its data] code 80040E14 source microsoft OLEDB provider for ODBC drivers Any help please    

SharePoint 2010 Export list Items to Excel, wrong url in iqy file

Hi, I have a SharePoint 2010 Environment that uses https://portal.<something>.com. Exporting to Excel of a list uses wrong URL. When I go to the a list, select the list to show the "office ribbon" and then select export to excel, excel will show the error "Excel cannot connect to the SharePoint List". When I take a look at the IQY file that is created it contains the wrong url: http://portal.<something>.com instead of https://portal.<something>.com Changing the URL in the IQY file manualy to https://portal.<something>.com and then opening it will excel is working fine, list data is exported to excel then. Alternate access mapping is configured to use https://portal.<something>.com as default, export to access is working normaly. I already deleted the http://portal.<something>.com alternate access mapping once to see if this fixes the problem. No fix, even not after IISreset or rebooting the server. Where or how is the export to Excel IQY file created and where is it possible to fix the URL it is putting in the IQY file? Grtz, Arjan

How to import two excel files into one list?

I know that I can export Excel data into new list in MOSS 2010 via Excel 2010. But when I was trying to add data into existing list, it was impossible. I know one way - copy data in Excel and paste it into the list in DataSheet View. Is there another way?

data type problem in import data from excel file


Dear All,

I am importing the data from excel file using following code.

connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(strFolderFileName) & ";Extended Properties=HTML Import;"
                conn = New OleDbConnection(connstr)
                Dim strSQL As String = "SELECT * FROM [" & strWorkSheetName & "]"

                Dim cmd As New OleDbCommand(strSQL, conn)

                Dim da As New OleDbDataAdapter(cmd)

Now the problem is if a coulmn vlaue start with a number value like "15" then the other string value like "W15" in that column is ignored in the datatable.

eg. The excel column value     Column1


Import Excel File in SQL Server


Dear all,

I have to create one page where user will upload the excel file in SQl Server and system should check following things

1.Sheet Name should be always sheet1

2.System should check the column names

3.System should show the message that these many rows has been loaded



Import Excel-File (OPENROWSET) on x64 SQL Server


Hi, recently I encountered the following problem:

I tried to execute a stored procedure on the newly installed SQL 2005 Server (now on x64 Win Server 2003) which imports an Excel-File into a DB table.

We use OPENROWSET to access the Excel data. But I recognized this is dependent on Jet OLE DB which seems is not available for x64 windows.


Is there another way to import excel data using a stored procedure.


thank you in advance, rene

Import and Export List data in excel sheet


Hi ,

I need to import based selective data from excel sheet and export data from sharepoint list, I'm new in Sharepoint.

can anybody guide me? What all possible ways are there and which would be the best.



Import file names from a folder


First of all, I only know VB (I know that isn't great but it's all I got).

Second, I have a folder with 200+ pictures.  I want to get the names of each of the pictures to the database. 

Last, would it be easier to import and export the images into the database (I want my webpage to be able to show the images once they are in the database)?



Trying to import from Excel file


I have been trying to import from an Excel file and insert it into a table.

I can upload the Excel file

I can view the Excel file in a grid

But when I run the import process to insert the rows in the Excel file I get only one row and it has all nulls except the dateentered and entered by field.

I added breakpoints and tried setting a couple of the fields to labels and I could see that data was getting to the reader.

So now I hoping someone might see something I'm missing here.

Protected Function ExcelConnection() As OleDbCommand

        ' Connect to the Excel Spreadsheet (online) = .ACE.OLEDB.12.0 (local) = .Jet.OLEDB.4.0
        Dim xConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                    "Data Source=" & Server.MapPath("~/Import_Process/ExcelImport_vol.xls") & ";" & _
                    "Extended Properties=Excel 8.0;" 'HDR=NO;IMEX=1"

        ' create your excel connection object using the connection string
        Dim objXConn As New OleDbConnection(xConnStr)

        ' use a SQL Select command to retrieve the data from the Excel Spreadsheet
        ' the "table name" is the name of the worksheet within the spreadsheet
        ' in this case

Import Excel file with Data Connection into SSIS


I have got an Excel spreadsheet with a Data Connection that I want to import into SSIS. The problem is that the Data Connection does not seem to run at the time the file is imported, so it only calls "old" data.

How can I set SSIS up to run the Data Connection first, or is there something I need to change in my Excel spreadsheet setup?

When a person opens the Excel file normally, they first need to "Enable" the Data Connection in the Security Settings. Once that is done the data will update immediately. I wonder if that is something I somehow need to change to make it work in SSIS?

SSRS Export to Excel Multiple Sheets empty First Row


I have a report with four tables. There are page breaks in between each table (the Insert Page Break After this table option is selected on the first three tables). When I export this report to Excel, there are four sheets with the four tables of data on them. The 2nd, 3rd and 4th sheets all have the first row empty and its height is set to 0 so it looks like rwo 2 is the first one but row 1 is actually hidden. I need this row and would like the data to be populated in the first row and not the second. Has anyone come across this before?



Import Excel File to Sql Server on a 64 bit machine


I need to import Excel (xls - 2003-2007) data into a Sql Server 2008 database. Both the Excel file and the database live on a Windows Server 2003 R2 sp2 64 bit machine.  I’m fine with it running in 32 bit mode but it all needs to happen on the same server. Also, I would like it to run in T-Sql but as a fallback we can do this in SSIS.

My T-Sql code which runs fine on a 32 bit machine is as follows:

SELECT * Into #TempTable From OpenRowSet('Microsoft.Jet.Oledb.4.0','Excel 8.0;Database=\\Servername\Folder\filename.xls;HDR=NO;IMEX=1', 'select * from [Main$]')


On the 64 bit server:

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend