Tech Support > Microsoft Windows > Windows CRM > Can not open exported Excel file
Can not open exported Excel file
Posted by Imran on August 1st, 2007


Hi all,
Problem - I can not programmatically open an Excel file, exported by MS CRM.

Description - I have created a view for contacts. I can export the resultant
records in an Excel file. Now, I have another web application (VB.Net) which
opens the Excel file to get the CRM contacts data.
I have used following code to open the excel file

/////////////// Code //////////
Dim strConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" & strFilePath & "; Extended Properties=Excel 8.0;"

'Open Connection
con = New OleDbConnection(strConnectionString)
con.Open()
////////Code end ///////////

But the con.Open() statement gives error as "external table is not in the
expected format"
Can somebody help??

I googled for it and found a workwround to open the excel file manually by
double clicking it as use "Save As" to save it as MS Excel file format.
After doing this I can open it programmatically, but I dont want to do this
manual file opening.

Pls provide some solution.
Thanks in advance

-Imran


Similar Posts