50 = xlExcel12 (Excel Binary Workbook in 2007 with or without macro’s, .xlsb) 56 = xlExcel8 (97-2003 format in Excel 2007, .xls) Note : I always use the FileFormat numbers instead of … I changed fPath and fname to go to my computer with paths that I know have worked before, and still couldn't get it to work, and I … You can easily add any type of workbook, whether it's a .xlsm, xlsx, xlst etc., using the Method workbooks.add Using this vba method, one can achieve as follows: You can add a workbook.add method to a variable: Dim wb as workbook set wb=workbooks.add can process creating a new workbook and manipulate the created workbook as desired.… If you run the code in Excel 2007-2016 it will look at the FileFormat of the parent workbook and save the new file in that format. OzGrid Free Excel/VBA Help Forum. Same directory as where you saved it - it'll be named as Backup of (FileName).xlk. Introduction/Problem Statement/Business Need: This article is to Create New Workbook using VBA code. i just wanted to take my existing workbook and save it as another file name in the same directory, so i left off the Workbook.Add command. I just realized that I didn't look at your code closely. Re: Workbook.SaveAs Method - CreateBackup - Where is the backup file? Excel General. Re: Workbook SaveAs I tried to figure it out but was unable to. HELP FORUMS. Thank you, Dave. Add New Workbook With Name ... Set wbNew = Workbooks.Add() wbNew.SaveAs Filename:="Your path and name" End Sub ... Trophies 1 Posts 24. i got it to work after i followed your syntax. In many cases, the user would like to create new workbook or new excel file without manual intervention. I didn't realized that thisWb is a created object.
If the parent workbook … Jan 16th 2008 #3; Re: Add New Workbook With Name. Typical use cases are while working in an Excel File, you would like to send calculated output to a separate file to a new path. here's my fixed code.

But I prefer not to save a hard copy on hard drive and delete it later. i thought it was a built-in object haha. Only if the parent workbook is an xlsm file and if there is no VBA code in the new workbook it will save the new file as xlsx.