- Excel
-
2012-01-21 - 更新:2012-12-19
Sub auto_open()
Dim myFileName As String
Dim myShape As Shape
myFileName = ActiveWorkbook.Path & "\sample.bmp"
' 選択位置に画像ファイルを挿入し、変数myShapeに格納
Set myShape = ActiveSheet.Shapes.AddPicture( _
Filename:=myFileName, _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=Selection.Left, _
Top:=Selection.Top, _
Width:=0, _
Height:=0)
' 挿入した画像に対して元画像と同じ高さ・幅にする
With myShape
.ScaleHeight 1, msoTrue
.ScaleWidth 1, msoTrue
End With
End Sub
ACCESSからExcelを操作し、挿入する場合
続きを読む…»
12,109 views




