+ Reply to Thread
Results 1 to 6 of 6

How to ensure that both .xls and .xlsx extentions respond to a command

  1. #1
    Registered User
    Join Date
    12-04-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    43

    Exclamation How to ensure that both .xls and .xlsx extentions respond to a command

    I am using codes like
    Workbooks.open("C:\XYZ\abc.xls"
    Some users of my application, may have that file in 2007 version i.e. abc.xlsx.

    How can I ensure that Workbooks.open respond to both xls and xlsx files.

    Thanks

    Vivek

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: How to ensure that both .xls and .xlsx extentions respond to a command

    "....xl*"

    Adding the * as a wildcard works for me.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: How to ensure that both .xls and .xlsx extentions respond to a command

    Hi there,

    Try using:

    Please Login or Register  to view this content.
    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: How to ensure that both .xls and .xlsx extentions respond to a command

    Maybe try use wildcard

    Workbooks.open("C:\XYZ\abc.*")

  5. #5
    Registered User
    Join Date
    12-04-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: How to ensure that both .xls and .xlsx extentions respond to a command

    Neither abc.xl* method nor abc.* method is working. The method suggested by Greg M is working. Yet I want some kind of short method to do it. Because users of my applications may be using 2003 or 2007 or even later versions. I want some shortcut method to do it because I need it at many places in my codes.

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: How to ensure that both .xls and .xlsx extentions respond to a command

    Hi again,

    Does the following provide the sort of shortcut you have in mind?

    Please Login or Register  to view this content.
    Hope the above helps - as before, please let me know how you get on.

    Regards,

    Greg M

+ 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. Extracting different cells data from Entry.xlsx to Report.xlsx
    By paradise2sr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2014, 10:04 AM
  2. Replies: 1
    Last Post: 12-10-2013, 12:11 PM
  3. Replies: 6
    Last Post: 08-28-2012, 03:51 AM
  4. How to add the columns data of several xlsx files of a folder in another xlsx file
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-25-2012, 04:29 AM
  5. deleting files by extentions
    By sshehab in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2010, 02:03 PM

Tags for this Thread

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