Change of plot.... In a Chinese web ... found a neat trick of saving as web page... Works great with a few additions... and file deletions
' better to save as HTML ....as per
'http://cat14051.mysinablog.com/index.php?op=ViewArticle&articleId=72135
Sub SaveBySheetHtmlx()
Dim FilesN% ' count files
Pictw.Copy ' get working picture to clipboard
' from Emily's Blog put it to a new workbook
Set Wks = Workbooks.Add.Sheets(1)
Application.Goto Wks.Range("A1")
ActiveSheet.Paste
' the save will set up a html with images in PATH_files
' so delete these from previous saves to avoid overwrite questions
'ScriptFolderExists also counts files into filesN
If ScriptFolderExists("F:\compw\tempw_files", FilesN) Then
If FilesN > 0 Then Kill "F:\compw\tempw_files/*.*"
RmDir "F:\compw\tempw_files"
Kill "F:\compw\*.*"
End If
' this puts original as image001.jpg and image002.jpg in "F:\compw\tempw_files
Wks.SaveAs Filename:="f:\compw\TempW.htm", FileFormat:=xlHtml
Wks.Parent.Close False
'then fix the comments and tags etx fixCommentsSave below
End Sub
Sub fixCommentsSave()
Dim sz&, PathN$, PathTags$, PathTo$, idprog&, shs$
' the tags are not in image002 so move them from image001
PathN = "f:\compw\TempW_Files\image002.jpg"
PathTags = "f:\compw\TempW_Files\image001.jpg"
If ScriptFileExists(PathN, sz) Then
Cells(7, 4) = sz ' sz is the size
'exiftool -TagsFromFile src.jpg -all:all dst.jpg
'use exiftool to copy tags etc
shs = "c:\exift\exiftool.exe "
shs = shs & "-tagsFromFile " & Chr(34) & PathTags & Chr(34)
shs = shs & " -all:all "
shs = shs & Chr(34) & PathN & Chr(34)
Cells(14, 4) = shs ' to look at exif message
idprog = Shell(shs)
' to be sure that process has ended.. else goes on after excel is ended.
Iexit = IsRunning(idprog) ' standard exif wait until done
Else
Cells(7, 4) = " not found "
PathN = PathTags ' get original instead
End If
' copy image002.jpg to where it is needed cells(3,11) is path cells(4,11) is name
PathTo = Cells(3, 11) & "\" & Cells(4, 11) & ".jpg"
Cells(5, 11) = PathTo ' show what files
Cells(6, 11) = PathN
FileCopy PathN, PathTo
End Sub