+ Reply to Thread
Results 1 to 4 of 4

Excel VBA to Crop / Merge .jpg's

  1. #1
    Registered User
    Join Date
    07-14-2016
    Location
    Ohio
    MS-Off Ver
    2016
    Posts
    5

    Excel VBA to Crop / Merge .jpg's

    Hey guys,
    I'm new to the forum and new to VBA (and coding, in general) - I was hoping that someone here could help get me pointed in the right direction.

    I've created a user form in Excel which takes user input and copies it to specific cells in the workbook. In this user form, I would also like to be able to select 3 .jpg images and have VBA crop them to a specific size, merge them like a collage, add a text overlay (watermark), and save the new image as a .jpg to a specific folder with a name taken from a cell in the workbook (basically an item #, which would change for each set of pictures). I've been looking around online but haven't found much to help - does VBA have the ability to do something like this or should I be looking for a different method?

    As a followup, I was able to create code in Python which performs these image functions. If I can't code these functions directly into VBA, is it possible to have VBA launch a Python script with inputs taken from the user form?


    Any help would be greatly appreciated.
    Thanks!

  2. #2
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Excel VBA to Crop / Merge .jpg's

    Try this:
    Please Login or Register  to view this content.
    Or if the python script is in the same folder as the workbook, then you can try :
    Please Login or Register  to view this content.
    All details within <> are to be given. <> - indicates change-able fields

    I guess this should work. But then again, if your script is going to call other files which are in different folders, it can cause errors unless you script has properly handled it. Hope it helps.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-14-2016
    Location
    Ohio
    MS-Off Ver
    2016
    Posts
    5

    Re: Excel VBA to Crop / Merge .jpg's

    Thanks for the response, I'll give that a shot. Is there a way to have the user inputs in the excel user form (in this case, the location of specific picture files) serve as the input for the Python script?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,620

    Re: Excel VBA to Crop / Merge .jpg's

    Is the Python script set up to take the filenames as input?

    Perhaps something using sys.argv to get arguments passed via the command line.
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to crop a part of the URL using excel formula
    By 99problems in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-28-2016, 06:39 PM
  2. Replies: 0
    Last Post: 05-06-2015, 04:25 AM
  3. Excel Macro Import web image, crop, and resize.
    By jdax57 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-17-2009, 08:30 AM
  4. [SOLVED] crop files
    By Rossella in forum Excel General
    Replies: 9
    Last Post: 04-24-2006, 07:55 PM
  5. Is there a way to crop text in an Excel cell?
    By cochranrg in forum Excel General
    Replies: 6
    Last Post: 12-13-2005, 11:10 AM
  6. Crop Text to Col Width
    By rrstudio2@icqmail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2005, 04:10 PM
  7. Crop text
    By 0-0 Wai Wai ^-^ in forum Excel General
    Replies: 1
    Last Post: 09-08-2005, 06:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1