Hallo zusammen,
hat jemand von euch vieleicht schon eine Funktion um ein Bild aus einem Ordner in eine Zelle einzufügen? Wenn ja wäre toll, da ich momentan nich weiss, wo ich dabei anfangen soll. Danke vorab für eure Antworten.
Gruß Alex
Hallo zusammen,
hat jemand von euch vieleicht schon eine Funktion um ein Bild aus einem Ordner in eine Zelle einzufügen? Wenn ja wäre toll, da ich momentan nich weiss, wo ich dabei anfangen soll. Danke vorab für eure Antworten.
Gruß Alex
Moin, um ein Bild über Autoit in Exel einzufügen ohne das Fenster hin und her zu schieben und Mausklicks zu machen geht es nur über ein ExelObejct mit der Method oExel.AddPictrure siehe http://msdn.microsoft.com/en-us/library/…office.12).aspx
Gruß Marvin
;===============================================================================
;
; Description: Insert a picture from a separate file into the active sheet.
; Syntax: _ExcelPictureInsert($oExcel, $sFilePath, $iLeft, $iTop, $iWidth, $iHeight, $fLinkToFile = False, $fSaveWithDoc = False)
; Parameter(s): $oExcel - An Excel object opened by a preceding call to _ExcelBookOpen() or _ExcelBookNew()
; $sFilePath - The full path of the picture to be inserted
; $fLinkToFile - "True" to link the picture to the file from which it was created.
; "False" to make the picture an independent copy of the file. The default value is False.
; $fSaveWithDoc - "True" to save the linked picture with the document. The default value is False.
; $iLeft - The position (in points) of the upper-left corner of the picture relative to the upper-left corner of the worksheet
; $iTop - The position (in points) of the upper-left corner of the picture relative to the top of the worksheet
; $iWidth - The width of the picture, in points
; $iHeight - The height of the picture, in points
; Requirement(s): None
; Return Value(s): On Success - Returns an object representing the inserted picture
; On Failure - Returns 0 and sets @error on errors:
; @error=1 - Specified object does not exist
; Author(s): SEO <locodarwin at yahoo dot com>
; Note(s): None
;
;===============================================================================
Func _ExcelPictureInsert($oExcel, $sFilePath, $iLeft, $iTop, $iWidth, $iHeight, $fLinkToFile = False, $fSaveWithDoc = False)
If NOT IsObj($oExcel) Then Return SetError(1, 0, 0)
If NOT FileExists($sFilePath) Then Return SetError(2, 0, 0)
If $iLeft < 1 Then $iLeft = 1
If $iTop < 1 Then $iTop = 1
If $iWidth < 1 Then $iWidth = 1
If $iHeight < 1 Then $iHeight = 1
$oExcel.ActiveSheet.Shapes.AddPicture($sFilePath, $fLinkToFile, $fSaveWithDoc, $iLeft, $iTop, $iWidth, $iHeight).Select
Return $oExcel.Selection.ShapeRange
EndFunc ;==>_ExcelPictureInsert
Vielen Dank für eure Hilfe, besonders an Xenobiologist für die fertige Funktion. ![]()