+ Reply to Thread
Results 1 to 5 of 5

VBA only opening XLSM and not other extension

  1. #1
    Registered User
    Join Date
    07-10-2019
    Location
    Hengelo, NL
    MS-Off Ver
    Office 2016
    Posts
    35

    VBA only opening XLSM and not other extension

    All,

    I'm running below code
    Please Login or Register  to view this content.
    If the "OtherWorkbook" has an xlsm extension it will open, if it has any other excel extensions it will not open. I'm getting an error saying the file extension is not correct.
    Any help? I find it weird. I don't see anywhere in the code referring to only open xlsm files.

    Any help would be much appreciated.

    -=CWever=-

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: VBA only opening XLSM and not other extension

    Hi, the code looks okay for as far as I can see. Without tyhe actual file you're using to do this I cannot tell what's in the userform you're using.
    The only thing that I can come up with is that either the selected file(s) have an incorrect extension or that you're changing the extension when the code in the userform is executed
    May you've accidentally include a FiletType parameter?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA only opening XLSM and not other extension

    As a test, can you manually open the other files without error?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    07-10-2019
    Location
    Hengelo, NL
    MS-Off Ver
    Office 2016
    Posts
    35

    Re: VBA only opening XLSM and not other extension

    Quote Originally Posted by Keebellah View Post
    Hi, the code looks okay for as far as I can see. Without tyhe actual file you're using to do this I cannot tell what's in the userform you're using.
    The only thing that I can come up with is that either the selected file(s) have an incorrect extension or that you're changing the extension when the code in the userform is executed
    May you've accidentally include a FiletType parameter?
    As far as I can read and understood, no I did not use the FileType parameter.

    Here is the User.Form code.

    Please Login or Register  to view this content.
    And no, I don't change the file extension anywhere and neither manually.
    And all files open if I open them normally.

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: VBA only opening XLSM and not other extension

    Have you check what @AlfaFrog suggested?
    BTW the macro code is of no help, I suggest you attach the file WITH the macro's

+ 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: 2
    Last Post: 03-14-2016, 10:51 AM
  2. [SOLVED] File Save As - change extension to .xlsm
    By rtcwlomax in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2015, 01:04 PM
  3. [SOLVED] File Save As - change extension to .xlsm
    By rtcwlomax in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2015, 09:22 AM
  4. How To Save Macro File Not Using .XLSM Extension
    By crouching_tiger in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2014, 07:37 AM
  5. XLSM file extension questions
    By johanna0507 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-19-2012, 08:33 AM
  6. Worksheet Change Macro without .xlsm extension
    By alexwgordon in forum Excel General
    Replies: 2
    Last Post: 08-25-2011, 08:33 PM
  7. Excel 2007 : Opening file with extension xls
    By Badone54 in forum Excel General
    Replies: 1
    Last Post: 04-20-2010, 04:02 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