+ Reply to Thread
Results 1 to 13 of 13

Saving an xlsm file as xls

  1. #1
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Saving an xlsm file as xls

    Hi

    This is in continuation of following discussion, but since I had marked that thread as closed, I am starting a new thread.

    http://www.excelforum.com/excel-prog...in-2003-a.html

    As mentioned in above thread, I had issues opening an xlsm file with excel 2003. So, I opened it with 2007, and saved it as .xls file. Now, I am able to open and run this .xls (2003) file with both excel 2003 and 2007, without any issues.

    I need to distribute this file to a no. of users. One option is to distribute 2 versions - .xls for 2003 users and .xlsm for 2007 users.

    However, I ran .xls (2003) with both excel 2003 and 2007, and I don't see any loss of functionality in any version.

    So, my question is, can I distribute .xls for both sets of users? Is this group aware of any specific functionalities that won't work if a .xls file is run on 2007?

    I hope my question is clear.

    tia
    Ajay

  2. #2
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: Saving an xlsm file as xls

    I found at least one scenario where 2003 willl not work as expected.
    Following check will fail in 2003 as max rows is 65536 in 2003, and 1048576 in 2007.

    Please Login or Register  to view this content.
    I guess I will have to add a vesion check, and accordingly check for 65536 or 1048576.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Saving an xlsm file as xls

    Change to using Columns.Count & Rows.Count
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Saving an xlsm file as xls

    Hi ajaykgarg,

    I am not an expert but will give you what knowledge I do have about this topic. Some of the functionality between 2003 and 2007 are different. Most are the same and so if you use common funcitons then there will probably be no problem. You should run tests on machines running both versions before distributing.

    As for 65536 vs. 1048576, unless your sheet requires more than 65536 rows then you can probably use this number for both excel 2003 and 2007. I tend to do this so that the code does not crash when it reads 1048576.

    Good luck.

    abousetta

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Saving an xlsm file as xls

    There's no need for a version check. Anticipating the increase in Rows/Columns most coders changed their coding methods before it was released.

    Please Login or Register  to view this content.
    Use Columns.Count for Columns

  6. #6
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: Saving an xlsm file as xls

    Thanks RoyUK and abousetta.

    I have modified my code to following:-

    Please Login or Register  to view this content.
    It seems to be working fine.
    Do you foresee any issue with this?

    tia
    Ajay

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Saving an xlsm file as xls

    yes, my suggestion limits the rows, yours searches the whole column. Could slow the code considerably

  8. #8
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: Saving an xlsm file as xls

    I am storing no. of used rows in a variable, so I modified your code as follows:-
    Please Login or Register  to view this content.
    Any issues with this?

    Also, if anyone can think of any other functions that will not work with 2003, pl. let me know.

    tia
    Ajay

  9. #9
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Saving an xlsm file as xls

    You need a start row in your range address too.
    Remember what the dormouse said
    Feed your head

  10. #10
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: Saving an xlsm file as xls

    romperstomper, will start row improve performance further, or do you think the code won't work at all without start row?
    (I ask because the code is working without that.)

    tia
    Ajay

  11. #11
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Saving an xlsm file as xls

    I'd be very worried if you can use:
    Please Login or Register  to view this content.
    without error. It should be:
    Please Login or Register  to view this content.
    for example.

  12. #12
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: Saving an xlsm file as xls

    Well, Upon re-looking my code closely, I realized that it was working without error because of
    Please Login or Register  to view this content.
    just before the if statement.

    Thanks.

    I am planning to change my code to:-
    Please Login or Register  to view this content.
    It works, and I guess it will work with every version, as it does not have 65536 or 1048576 hard coded. Can you think of a scenario when it might not work?
    tia
    Ajay

  13. #13
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Saving an xlsm file as xls

    No, but you could also use:
    Please Login or Register  to view this content.

+ 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