Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2007 connection via oledbconnection
I'm trying to open a connection to an excel 2007 file ( xlsx ) with
OleDbConnection. The excel file in question contains a couple of worksheets, some of them have graphs/charts on it and no data. This is the connection string I use: string con = "Provider = Microsoft.ACE.OLEDB.12.0;Data Source = " + fileName + ";Extended Properties =\"Excel 12.0 Xml;HDR=YES;IMEX=1\";"; OleDbConnection DBCon = new OleDbConnection(con); DBCon.Open(); // failed It failed with an "External table is not in the expected format" exception. Two points I found: 1. It works fine if I have the excel file open 2. It works fine if I remove all the worksheets with the graphs/charts in it My question is if there is any option to include in the connection string to ignore the graph/chart in the excel file? Just so that the connection to the file can be opened.. any help will be much appreciated.. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 data connection | Excel Discussion (Misc queries) | |||
Data Connection between Excel 2007 and SharePoint 2007 | Excel Discussion (Misc queries) | |||
Data Connection Security in Excel 2007 | Setting up and Configuration of Excel | |||
Problem opening Excel 2007 file from OleDbConnection | Excel Programming | |||
Excel 2007 - The connection for this PivotTable has been deleted | Excel Discussion (Misc queries) |