如何根据ID或NO在excel 2007中插入图像? [英] How to insert image in excel 2007 based on ID or NO ?

查看:136
本文介绍了如何根据ID或NO在excel 2007中插入图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在windows表单应用程序中工作c#vs 2015

我可以在excel中插入数据但是图片无法插入

当我使用
$ b插入另一个数据时$ b

I work in windows form application c# vs 2015
I can insert data in excel but image cannot insert
when insert another data i using

System.Data.OleDb.OleDbCommand excelCommand = new System.Data.OleDb.OleDbCommand("INSERT INTO [AllPrinting$](UserID,UserName,Country,Member) VALUES (?,?,?,?)", excelConnection);



我可以插入但图片无法插入

如何在Excel工作表中插入图片?

我需要的插入是


and i can insert but image cannot insert
how to insert image in excel sheet ?
my insert i need is

"INSERT INTO [AllPrinting$](UserID,UserName,Country,Member,Imag) VALUES (?,?,?,?,?)"



以便如何根据ID在excel上插入图像或否

我在互联网上搜索更多但没有得到任何东西?



我的尝试:




so that how to insert image on excel based on ID OR No
I Search more on internet but not got any thing ?

What I have tried:

How to insert image in excel 2007 ?

推荐答案

(UserID,UserName,Country,Member)VALUES(?,?,?, ?),excelConnection);
(UserID,UserName,Country,Member) VALUES (?,?,?,?)", excelConnection);



我可以投入ert但图片无法插入

如何在Excel工作表中插入图片?

我需要的插入是


and i can insert but image cannot insert
how to insert image in excel sheet ?
my insert i need is

"INSERT INTO [AllPrinting


(UserID,UserName,Country,Member,Imag)VALUES(?,?,?,?,?)
(UserID,UserName,Country,Member,Imag) VALUES (?,?,?,?,?)"



如何根据ID在excel上插入图像或者否

我在互联网上搜索更多但没有得到任何东西?



我的尝试:




so that how to insert image on excel based on ID OR No
I Search more on internet but not got any thing ?

What I have tried:

How to insert image in excel 2007 ?


对不起,但使用OLEDB是不可能的。



OLEDB是一个数据库接口,只支持基于单元格导入/导出Excel。但是图像不会使用Excel存储在单元格中。它们是单独显示在单元格上方的单独对象。





如果需要导出图像,则必须选择支持的方法它。



Excel自动化/ Microsoft Office Interop(需要安装Excel)

如何从Microsoft Visual C#.NET自动化Microsoft Excel [ ^ ]



对于新的(Office 2007 XLSX)文件格式,您可以使用Open XML SDK:

欢迎使用Open XML SDK 2.5 for Office [< a href =https://msdn.microsoft.com/en-us/library/bb448854(v=office.15).aspx\"target =_ blanktitle =New Window> ^ ]

读写Open XML文件(MS Office 2007) [ ^ ]



还有第三方图书馆(免费和商业)。从我的角度来看,这些应该只用于旧的XLS文件格式,并且当使用自动化时不可能(Excel没有安装在所有客户端上)。



只是查询具有上述关键字的搜索引擎(例如c#excel export< method>;也可选择image)以获取更多信息。

[/ EDIT]
I'm sorry, but this is not possible using OLEDB.

OLEDB is a database interface and supports only cell based import/export for Excel. But images are not stored within cells with Excel. They are separate objects just shown above cells.


If you need to export images you have to choose a method that supports it.

Excel Automation / Microsoft Office Interop (requires installed Excel)
How to automate Microsoft Excel from Microsoft Visual C#.NET[^]

For the new (Office 2007 XLSX) file formats you can use the Open XML SDK:
Welcome to the Open XML SDK 2.5 for Office[^]
Read and write Open XML files (MS Office 2007)[^]

There are also third party libraries (free and commercial). From my point of view these should be only used for the old XLS file format and when using automation is not possible (Excel not installed on all clients).

Just query a search engine with the above keywords (e.g. "c# excel export <method>"; optional also with "image") to get more information.
[/EDIT]


这篇关于如何根据ID或NO在excel 2007中插入图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆