怎样调整导出的excel中图片大小,该怎么解决
怎样调整导出的excel中图片大小
代码如下,但插入的图片是原始图片大小,我改图片的大小调整成单元格的大小.
oXLApp = New Application()
oXLBook = oXLApp.Workbooks.Add()
oXLSheet = oXLBook.Worksheets("Sheet1") 'Work with the first worksheet
Dim cn As New OdbcConnection(strCon)
cn.Open()
Dim strSql As String = "Select * from products "
Dim cmd As New OdbcCommand(strSql, cn)
Dim dr As OdbcDataReader = cmd.ExecuteReader
With oXLSheet
.Columns("A:A").ColumnWidth = 22.25
While dr.Read
.Rows(intRow.ToString() + ":" + intRow.ToString()).RowHeight = 102
.Range("B" + (intRow).ToString() + ":B" + (intRow).ToString()).Value = dr("products_model")
.Range("C" + (intRow).ToString() + ":C" + (intRow).ToString()).Value = dr("products_image")
.Range("A" + (intRow).ToString() + ":A" + (intRow).ToString()).Select()
.Pictures.Insert( dr("products_image")).Select()
intRow += 1
End While
End With
oXLApp.Visible = True 'Show it to the user
------解决方案--------------------
是不是可以设置控件属性
------解决方案--------------------
是导出到EXCEL中的内容有图片么?
建议先对图片进行处理后再贴进EXCEL
放进EXCEL中再处理有点麻烦
------解决方案--------------------
不太懂,友情帮顶!
------解决方案--------------------
dim xRange as range=oxlsheet.(图片格子)
dim shape1 as shape=xrange.value
shape1.width=w '自己设
shape1.height=h '自己设
代码如下,但插入的图片是原始图片大小,我改图片的大小调整成单元格的大小.
oXLApp = New Application()
oXLBook = oXLApp.Workbooks.Add()
oXLSheet = oXLBook.Worksheets("Sheet1") 'Work with the first worksheet
Dim cn As New OdbcConnection(strCon)
cn.Open()
Dim strSql As String = "Select * from products "
Dim cmd As New OdbcCommand(strSql, cn)
Dim dr As OdbcDataReader = cmd.ExecuteReader
With oXLSheet
.Columns("A:A").ColumnWidth = 22.25
While dr.Read
.Rows(intRow.ToString() + ":" + intRow.ToString()).RowHeight = 102
.Range("B" + (intRow).ToString() + ":B" + (intRow).ToString()).Value = dr("products_model")
.Range("C" + (intRow).ToString() + ":C" + (intRow).ToString()).Value = dr("products_image")
.Range("A" + (intRow).ToString() + ":A" + (intRow).ToString()).Select()
.Pictures.Insert( dr("products_image")).Select()
intRow += 1
End While
End With
oXLApp.Visible = True 'Show it to the user
------解决方案--------------------
是不是可以设置控件属性
------解决方案--------------------
是导出到EXCEL中的内容有图片么?
建议先对图片进行处理后再贴进EXCEL
放进EXCEL中再处理有点麻烦
------解决方案--------------------
不太懂,友情帮顶!
------解决方案--------------------
dim xRange as range=oxlsheet.(图片格子)
dim shape1 as shape=xrange.value
shape1.width=w '自己设
shape1.height=h '自己设