+ Reply to Thread
Results 1 to 6 of 6

Help on the use of SaveCopyAs command in Macro

  1. #1
    Registered User
    Join Date
    10-27-2016
    Location
    Ontario, Canada
    MS-Off Ver
    2013
    Posts
    5

    Question Help on the use of SaveCopyAs command in Macro

    Hello; I'm wirting a macro to create records in a formatted form for each row in a spreadsheet
    Everything works ok; I can create as many forms as rows are populated with information.
    The issue I'm encountering is that the SaveCopyAs command creates files in version 2003; so every time I open the new created files a dialogue box appears to validate the file is ok to open. I'm creating hundreds of records.
    I need help with my command line to create files in the same version I'm working on 2013.
    Can anybody please help with suggestion for a different approach?
    Thanks so much for your help.

    this is the saving script in my macro:
    -----------------------------------

    Please Login or Register  to view this content.
    ----------------------------------
    Last edited by jeffreybrown; 10-27-2016 at 08:08 PM. Reason: Please use code tags. Thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,028

    Re: Help on the use of SaveCopyAs command in Macro

    You are giving the file a 2003 .xls extension. Try using 2007+ .xlsx extension.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-27-2016
    Location
    Ontario, Canada
    MS-Off Ver
    2013
    Posts
    5
    Quote Originally Posted by TMS View Post
    You are giving the file a 2003 .xls extension. Try using 2007+ .xlsx extension.
    If I use the .xlsx extension then the files created are useless unrecognized by excel; unreadable and excel doesn't open files
    Macro runs with .xls extension.
    Are there any other suggestions?
    Thanks

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,028

    Re: Help on the use of SaveCopyAs command in Macro

    What type of file is the original? If that is .xls, I think you should convert it to .xlsm.

  5. #5
    Registered User
    Join Date
    10-27-2016
    Location
    Ontario, Canada
    MS-Off Ver
    2013
    Posts
    5
    Quote Originally Posted by TMS View Post
    What type of file is the original? If that is .xls, I think you should convert it to .xlsm.
    The original file is .xlsm
    All outputs should be saved without macro as .xlsx
    I want to keep the original unchanged so I can continue running with all target sources.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,028

    Re: Help on the use of SaveCopyAs command in Macro

    My understanding is that SaveCopyAs does exactly that ... saves a copy of the workbook with its existing format. If you are trying to change the file extension, that is probably why you get the warning message when you next open the copy.

    I think you would need to use SaveCopyAs to make an exact copy, then open the copy and use SaveAs to change the file extension and format in order to remove the macros.

+ 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. [SOLVED] SaveCopyAs macro
    By silentcarl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2015, 09:02 AM
  2. [SOLVED] VBA / Macro help needed to SaveCopyAs workbook with specific sheets
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-27-2013, 02:33 PM
  3. Macro - SaveCopyAs and Remove VBA Code
    By Mahew in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2011, 09:03 AM
  4. Macro To SaveCopyas and delete VBA Code From Excel Document
    By Mahew in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2011, 02:01 PM
  5. Using macro to execute a command in Shell Command
    By aadarsh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2010, 07:06 PM
  6. SaveCopyAs
    By tmkkoservo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-21-2007, 07:21 PM
  7. Having a SaveCopyAs macro update a database
    By tclarke in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-18-2005, 10:21 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