投稿日 | : 2005/05/18(Wed) 17:32 |
投稿者 | : かもあも |
Eメール | : |
URL | : |
タイトル | : エクセルに貼っている画像の削除 |
立ち上がっているエクセル上で以下のしたいと考えています。
@セルの行と列の取得
Aエクセルに貼っている画像の削除
以下のように書いてみたのですが、出来ません。
教えてください。
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim i As Integer
Dim j As Integer
Set xlApp = GetObject(, "Excel.Application")
Set xlBook = xlApp.ActiveWorkbook
Set xlSheet = xlBook.ActiveSheet
'セルの行と列の取得
i = xlSheet.ActiveCell.Row
j = xlSheet.ActiveCell.Column
'すべての図形を選択する
xlSheet.Shapes.SelectAll
'現在選択されているオブジェクトを削除する
xlSheet.Selection.Delete
xlApp.Visible = True
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing
Exit Sub