我发现很多问题对于相反的vb.net要擅长但没有用于将excel nav {
background-color: #7B7B7B;
width: 950px;
margin: 0 auto;
height: ; /* for ex. 75px */
}
中的图片放到图片框中。我的应用程序是一个模板,可以从excel文件中获取文本字符串。哪个工作正常,但现在我也试图传输图片。我尝试了cell(row,column)
但没有做任何事情。虽然没有错误!
将复制和粘贴工作吗?
代码:
picSpindle.Image = shXL.Cells(19, 2).Value
答案 0 :(得分:1)
答案 1 :(得分:0)
图像不在单元格内。但左上角的坐标指向一个单元格,使用上面的代码,您可以创建自己的搜索图像的功能。
你可以这样做:
shXL = wbXl.Worksheets("Sheet1")
' # Loop for all Shapes
' But I don't know what other controls over
' the images are considered "shapes",
' Perhaps the best way is to verify that
' in the "clipboard" there is truly a picture
For i = 0 To shXL.Shapes.Count - 1
'THIS IS THE MAIN POINT
' # get the pictures and copy to clipboard
'shXL.Shapes.Item(i).Copy()
' # paste the picture in the pictureBox from clipboard
'PictureBox1.Image = Clipboard.GetImage
'AND OTHER PROPERTIS
MsgBox(shXL.Shapes.Item(i).Name) ' the name in excel
MsgBox(shXL.Shapes.Item(i).AlternativeText) 'the name of the file
MsgBox(shXL.Shapes.Item(i).TopLeftCell.Column) 'the column position (of the top left corner)
MsgBox(shXL.Shapes.Item(i).TopLeftCell.Row) 'the row position (of the top left corner)
MsgBox(shXL.Shapes.Item(i).Width) 'the with in px
MsgBox(shXL.Shapes.Item(i).Height) 'the height in px
MsgBox(shXL.Shapes.Item(i).Top) 'the top in px
MsgBox(shXL.Shapes.Item(i).Left) 'the left in px
Next