+ Reply to Thread
Results 1 to 4 of 4

Obtain file extension

  1. #1
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Obtain file extension

    Morning to all the good people of Excel Forum;

    I'm in a bit of a situation. I have a file in the form of an Excel Macro-enabled templete. But when the user uses the file and then save, I don't want the user to have access to certain functions which I have already coded.

    So, my request is: How do I identify in VBA if my file in use is actually an *.xltm file or something else?

    The scenario I want to run is:

    Please Login or Register  to view this content.
    Any help will be greatly appreciated
    Last edited by Jacques Grobler; 12-22-2010 at 03:04 AM.
    Jacques


  2. #2
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: Obtain file extension

    Try this
    Please Login or Register  to view this content.
    rgds

    johnjohns

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Obtain file extension

    Hello Jaques,

    This UDF will return the extension of the open workbook. If it has not benn saved, the function returns an empty string.
    Please Login or Register  to view this content.

    Example
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Re: Obtain file extension

    Hi JohnJohns,

    Thanks for the reply, not entirely sure how this is suppose to work, but

    Hi Leith,

    Thanks, on the dot!

+ 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