Open an Excel template file populate data to save as a file

xiaoxiao2021-03-06  22

Recently made things are required to open an Excel file template fill data

I started using OLEDB to connect to this Excel file update is an error. "Need to be updated ....."

Http://expert.9cbs.net/expert/topic/2992/2992809.xml?temp=.4825403

If it is access this error, most of the permissions are caused, but I am doing WinForm permissions is admin.

Fade

Later, I was tested with ODBC.

After starting writing procedures, it is found that there will be that 2 cells do not listen to the parameter error.

depressed

http://expert.9cbs.net/expert/topic/3000/3000113.xml?temp=.3331262

Still there is still no fruit

No way to turn Google

obtain

http://www.c-sharpcorner.com/winforms/excelreadmg.asp

With COM components, feasible, 9CBS this morning, there are netizens PM I ask how to get it.

Then I wrote here.

The following is some of the code, you should add a COM reference before use.

...........

String strfilename =

Environment.currentDirectory @ "/ template / template.tpl

"" String strsavefilename =

Environment.currentDirectory @ "/ excel /" system.datetime.now.tostring (). Replace (":", ""). Replace ("-", ""). Replace

转载请注明原文地址:https://www.9cbs.com/read-40558.html

New Post(0)