开发者

OleDbConnection failed creating a new excel file

开发者 https://www.devze.com 2022-12-14 02:07 出处:网络
I have to use OleDbConnection to create a new excel file, but when I open connection with this string:

I have to use OleDbConnection to create a new excel file, but when I open connection with this string:

OleDbConnection excelConnection =
                new OleDbConnection(
     开发者_Python百科               String.Format(
                        @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Mode=ReadWrite;Extended Properties=""Excel 12.0;HDR=YES"";",
                        excelFile));

I receive an error that in english sounds like "The outer table is not in the expected format."

But the file is NEW and empty ... how can i do?


I have changed to ExcelPackage library, and now it works.

0

精彩评论

暂无评论...
验证码 换一张
取 消