#include <Excel.au3>
#include <File.au3>
Local $i_Err = 13, $sFilePath = @ScriptDir & '\x.xls', $oExcel, $sTempDir = @ScriptDir & '\Temp\', $sTemp = 'Images', _
$sImagesDir = $sTempDir & $sTemp & '.files\', $aImages, $a_Names[1], $iCount, $hFile
Do
$oExcel = _ExcelBookOpen($sFilePath, 0)
If @error Then ExitLoop
$oShapes = $oExcel.ActiveSheet.Shapes
ReDim $a_Names[$oExcel.ActiveSheet.Shapes.Count + 1]
For $oShape In $oShapes
If $oShape.Type = 13 Then
$a_Names[0] += 1
ConsoleWrite($oShape.Name & @LF)
$a_Names[$a_Names[0]] = $oShape.Name & '.jpg'
EndIf
Next
If Not $a_Names[0] Then ExitLoop
If Not FileExists($sTempDir) Then
If Not DirCreate($sTempDir) Then ExitLoop
EndIf
_ExcelBookSaveAs($oExcel, $sTempDir & $sTemp, 'html', 0, 1)
If @error Then ExitLoop
If Not FileExists($sImagesDir) Then ExitLoop
$aImages = _FileListToArray($sImagesDir, '*.jpg', 1)
If @error Then ExitLoop
$hFile = FileOpen(@ScriptDir & '\ImagesFiles.txt', 2)
For $i = 1 To $aImages[0] Step 2
$iCount += 1
If FileMove($sImagesDir & $aImages[$i], @ScriptDir & '\' & $a_Names[$iCount], 1) Then
FileWrite($hFile, @ScriptDir & '\' & $a_Names[$iCount] & @CRLF)
EndIf
Next
$i_Err = 0
Until 1
If IsObj($oExcel) Then _ExcelBookClose($oExcel)
If $hFile Then FileClose($hFile)
DirRemove($sTempDir, 1)
Exit $i_Err