+ Reply to Thread
Results 1 to 4 of 4

Images not files to be uploaded!!!

  1. #1
    Registered User
    Join Date
    02-12-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Images not files to be uploaded!!!

    Hi, every one my code below is for an image thing in a user form in vba. When the image is clicked on, this code will display a file picker to enable a user to select an image which calls a functions to do this, inputting the selected image into a worksheet. That all works fine and correct, however my problem is that it allows files and other things to be inputted into the worksheet which I don't want it to!!! If every one could help me with this I would be grateful!!!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Images not files to be uploaded!!!

    Hi,

    Can I suggest you upload the workbook, and tell us which image you are clicking.

    And assuming this pops up a standard Windows File Open dialog box, how is the macro to know whether the file that's being picked is not one that you want to bring in. Excel is not psychic. You may not know what's invalid but you need to provide a rule for Excel to work with.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-12-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Images not files to be uploaded!!!

    that's my problem really, I don't know how to tell the macro to only select and input an image.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Images not files to be uploaded!!!

    Quote Originally Posted by jakeembx View Post
    that's my problem really, I don't know how to tell the macro to only select and input an image.

    You may not know how to tell the macro to do it but you do do it manually? In your mind you must make some decision about which file/image to use or reject. Tell us what your thought process is and that will help decide how to encapsulate that in VBA. At it's simplest the rule may just be 'reject unless a .jpg file'. Or maybe you can only test the image after its imported, and then you could delete it or not if it doesn't meet whatever your criteria may be.

    One way or another you have to 'write down' the rule for us.

+ 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. Replies: 0
    Last Post: 09-24-2013, 03:22 PM
  2. referencing embedded images/files
    By jamesDecker in forum Excel General
    Replies: 1
    Last Post: 06-13-2013, 09:18 AM
  3. How can I delete files I have uploaded to this forum?
    By Carrfamily in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-11-2012, 03:10 PM
  4. Images in and from mdb-files
    By Willem Peper in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2006, 10:40 AM
  5. Rerieve Images from xls files and save them
    By blackpassword in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2005, 12:10 PM

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