Results 1 to 2 of 2
  1. #1
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419

    VBA to save a newly created workbook in a folder

    I have this code but it doesn't seem to always work.
    Gives error message script is out of range.




    Code:
    Workbooks(variable_wk).SaveAs FileName:= path & newNM & ".xlsx"

    is there another code ?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Make sure the sheet variable resolves to a valid sheet name and the path variables resolve to a valid path.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Newly created report is lost
    By Skydiver16 in forum Reports
    Replies: 2
    Last Post: 02-16-2017, 03:36 PM
  2. query not checking for newly created record
    By JWawrzak in forum Queries
    Replies: 3
    Last Post: 10-11-2016, 05:14 AM
  3. Replies: 4
    Last Post: 06-27-2013, 12:29 PM
  4. New Field Name on Newly created query
    By inan25 in forum Queries
    Replies: 3
    Last Post: 05-13-2009, 09:05 PM
  5. Best Way to Return a Newly Created Index?
    By Jerimiah33 in forum Programming
    Replies: 5
    Last Post: 09-06-2006, 12:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums