|
特定セル 画像 jpg で検索して出たサイトを参考にしました
原理はそこの人もよくわからないそうです
Sub aaa()
On Error GoTo hell
Dim a As String, b As String, c As Object, d As Worksheet
Application.DisplayAlerts = False
Application.ScreenUpdating = False
b = ThisWorkbook.Path & "\aaaaaaaaaaaaaaaaa"
Set c = CreateObject("Scripting.FileSystemObject")
'↓ここの範囲を適当に変える
ActiveSheet.Range("a1:g32").CopyPicture xlScreen, xlBitmap
Set d = Sheets.Add
d.Paste Destination:=d.Range("A1")
With ActiveWorkbook.PublishObjects.Add(xlsorcesheet, b & ".html", d.Name, "", xlHtmlStatic, "a")
.Publish (True)
.AutoRepublish = False
End With
d.Delete
'↓2007の場合はjpgをgifに変える
Name b & ".files\image002.jpg" As b & ".jpg"
c.DeleteFolder ("" & b & ".files")
Kill pathname:="" & b & ".HTML"
hell:
Set c = Nothing
Set d = Nothing
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
|
|