+ Reply to Thread
Results 1 to 3 of 3

Saving workbook as 2003 xls then reopen macro enabled workbook

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    7

    Saving workbook as 2003 xls then reopen macro enabled workbook

    Hi all,

    I am trying to put together a spreadsheet that, amongst other things, uses a macro to save the file in the existing xlsm format, then save the same sheets with an alternative name in 2003 compatible xls format and closing this workbook, before finally reopening the original xlsm document. I've got the first 3 parts working but not sure if there is a way of reopening the original doc via this macro as it will not always have the same name or be saved in the same directory.

    It would also be great to ignore any compatibility or overwrite checks and the code I have written doesn't seem to do this either!

    Any help would be very welcome! Thanks in advance.

    So far the section for this piece of the macro is:

    Sub Example ()

    ActiveWorkbook.Save

    Dim SvName2 As String
    SvName2 = Range("C2")
    ActiveWorkbook.Saveas Filename:=SvName2, FileFormat:=56
    Application.DisplayAlerts = False
    ActiveWorkbook.CheckCompatibility = False

    ActiveWorkbook.Close True

    End Sub

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Saving workbook as 2003 xls then reopen macro enabled workbook

    Hi, JPalms,

    maybe have a bit different go at that. Save the workbook as xlsm, copy the sheeets to a new workbook, save that as xls and close, you´re back in the original file.

    Please add Code Tags around the procedure as requested by Forum Rule #3 - thanks.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    10-24-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Saving workbook as 2003 xls then reopen macro enabled workbook

    Thanks Holger, I found a workaround similar to the one suggested that didn't require me to close out of the initial xlsm workbook.

    Cheers,
    JPalms

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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