Results 1 to 4 of 4
  1. #1
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts

    Cross Version Copy

    Hey Y'all,

    I just ran into an interesting problem. I have VBA code in a workbook that Opens a .csv file. Running Excel 2010 this code works just fine if I use the version of the file I saved as .xslm. However, I often save files in .xls format for compatibility with Office 2003 that is on my Laptop. This code runs fine on my laptop using the .xls file in Excel 2003.

    However, If I open the .xls file in Compatibility mode in Excel 2010 the program bombs on trying to copy a tab (worksheet) from the .csv file to the .xls file due to incompatible number of rows in the workbook! Yes, even though the file containing the VBA code is a .xls file when it opens the .csv file it opens in the format for 2010 which has considerably more rows than Excel 2003 causing the error. Yes, I know I can select just a region of used data and copy it to get around the problem. I've looked and there is no parameter on the Open command [ Workbooks.Open Filename:=zSrcPath & "\WinUpdList.csv"
    ] to tell it to open the csv file in compatibility mode. Think MS missed something here. FWIW
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  2. #2
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Praha
    Posts
    990
    Thanks
    56
    Thanked 105 Times in 90 Posts
    Can you use a File Converter, which is something you could invoke using the Converter parameter of the Workbooks.Open command ?

    That's all I can think of, as VBA is really only set up to make file type changes at Save rather than at Open, and at first sight it looks even more trouble than using a defined region

  3. #3
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Martin,

    Thanks! I did see that but where do you get the "converter"?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  4. #4
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Praha
    Posts
    990
    Thanks
    56
    Thanked 105 Times in 90 Posts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •