+ Reply to Thread
Results 1 to 3 of 3

Set file extention as variant

  1. #1
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Set file extention as variant

    Hello.

    I have a button the runs Application.GetOpenFilename And puts the output filepath into a label.

    I then have another button that opens a inputbox asking to change the file name and then copys the file from above path to my destenation.

    when setting the destination i use ThisWorkbook.Path & Application.PathSeparator & "Images" & Application.PathSeparator

    and the imputbox value as the filename.

    doing it like this it wont alocate a extention for the file ".jpg,ect".
    The label.caption has the .ext and i would like to be able to store everythink after the . as a variant.

    Thankyou.
    Last edited by D_Rennie; 07-01-2009 at 08:07 AM.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Set file extention as variant

    This code will error if there is no . in the file name

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Set file extention as variant

    Thankyou Mudraker.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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