+ Reply to Thread
Results 1 to 9 of 9

VB Code to Save file as 97-2003 Worksheet

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to Save file as 97-2003 Worksheet

    Hello:

    Please refer to attached sheet.
    I am using below code to rearrange the Clockin-Clockout of employees.
    I need to add the code which will Save and close the file in Microsoft Excel 97-2003 Worksheet in the same location as the original after rearranging is done.
    Please let me know if any questions.
    Thanks
    Riz

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by rizmomin; 01-23-2014 at 09:37 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VB Code to Save file as 97-2003 Worksheet

    Quote Originally Posted by rizmomin View Post
    ...Save and close the file in Microsoft Excel 97-2003 Worksheet in the same location as the original after rearranging is done.
    This implies that you don't want to simply save the original, but rather save a copy "in the same location as the original." How do you want to name the new file?
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to Save file as 97-2003 Worksheet

    Hello:

    The name of the file would be the same as original.
    Basically, after the rearrange of the data is done, then code needs to save the file in Microsoft 97-2003 Workbook with the original file name.

    Please let me know if any questions

    Thank u

    RM

  4. #4
    Forum Contributor
    Join Date
    04-25-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    150

    Re: VB Code to Save file as 97-2003 Worksheet

    Like this maybe?

    Please Login or Register  to view this content.
    Check this link for excel file formats: http://www.rondebruin.nl/mac/mac020.htm

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VB Code to Save file as 97-2003 Worksheet

    The file you attached is already in 97-2003 format. Can't you just use AcrtiveWorkbook.Save? It will keep whatever format the file is already in.

  6. #6
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to Save file as 97-2003 Worksheet

    Hello:

    By adding the code

    ActiveWorkbook.Save
    ActiveWorkbook.Close

    it gives Run Time erroe '1004
    Method Save' of object '_Workbook' failed.

    I would appreciate if you could try and let me know.

    Once again thank you for your help.

    Riz

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VB Code to Save file as 97-2003 Worksheet

    Something odd is happening. I save your file to disk, then open it using Excel 2013, then try to save it (using the Excel interface, not code) and I get the following error:

    '1-22-14_SF0003_TC_RPT.xls' cannot be saved in the current format. To save your changes, click OK, then save it as the latest format.
    I have never seen this error and do not know what causes it, but it may be related to why you are getting the error in the code.

    What happens when you open this file in Excel 2010 and then immediately try a save?

  8. #8
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to Save file as 97-2003 Worksheet

    Hello:

    I am using Excel 2013.
    But the file "1-22-14_SF0003_TC_RPT.xls" is Microsoft Excel 97-2003 Worksheet file.
    I will have quite a few files every day and would need to rearrange the Clockin-out data and save as MS Excel 97-2003 Worksheet file to work further with other applications.
    That's why i will be using above code to rearrange but stuck at automatically saving the file in MS Excel 97-2003 worksheet format.
    Please help.

    Thanks a lot

    Riz

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VB Code to Save file as 97-2003 Worksheet

    The code that djdjdj posted will force a save in the 97-2003 format. Try that.

+ 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. VBA Code needed to disable the Save-As feature on any Excel 2003 file
    By alchavar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2013, 08:11 PM
  2. Converting excel 2003 file ext macro file-save code to reflect excel 2007 exts
    By pmanoloff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 12:17 PM
  3. Macros To Save Worksheet as New xlsx file & Save Another Worksheet As A Text File
    By KeithT in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-16-2011, 05:13 PM
  4. VBScript Code to Save an Excel File in Excel 97-2003 Format
    By HishamSingalaxana in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-03-2010, 04:34 AM
  5. Can't save new file in Excel 2003
    By Sadretdinov Vadim in forum Excel General
    Replies: 0
    Last Post: 02-11-2005, 05:06 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