Jump to content

Search the Community

Showing results for tags 'Excel COM image'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Howdy all. I was searching the net trying to find an easy way to insert an image into Excel when I came accross this VBA Code: http://www.exceltip.com/general-topics-in-vba/insert-pictures-using-vba-in-microsoft-excel.html. I took a few minutes to translate it to AU3 and was pleased to see it actually worked. I thought I would share it in case anyone needed something like it. #include <Excel.au3> #include <Array.au3>; for expansion to do many pics from an array $oExcel = _ExcelBookNew() $path = @ScriptDir&"\[YOUR IMAGE NAME]" $targetRange=$oExcel.ActiveSheet.Range("B5:D10") Func _TestInsertPictureInRange() _InsertPictureInRange($path, $targetRange) EndFunc _TestInsertPictureInRange() func _InsertPictureInRange($path, $targetRange) ; inserts a picture and resizes it to fit the TargetCells range Dim $p, $t, $l, $w, $h ; import picture $p = $oExcel.ActiveSheet.Pictures.Insert($path) ; determine positions With $targetRange $t = .Top $l = .Left $w = .Offset(0, .Columns.Count).Left - .Left $h = .Offset(.Rows.Count, 0).Top - .Top EndWith ; position picture With $p .Top = $t .Left = $l .Width = $w .Height = $h EndWith $p = "Nothing" EndFunc Enjoy.
×
×
  • Create New...