VBA save as Workbook Excel Macro code helps Save file to a specific Folder, its is a common task in automation process. Once you are done with actual calculations or task, at end of the procedure we generally call a procedure to export or Save the Output File to a Specific Folder or co...
2、ThisWorkbook.SaveAs ' 另存为工作簿 把当前工作簿另存为一份新的工作簿 Workbook对象的SaveAs方法使用另外一个文件名保存对工作簿所做的更改,语法如下: SaveAs(FileName,FileFormat,Password,WriteResPassword,ReadOnlyRecommended,CreateBackup,AccessMode,ConflictResolution,AddToMru,TextCodepage,TextVisualLayout,Lo...
1 新建一个Excel文件并保存。打开VBE,可以用快捷键<Alt+F11>.VBE的介绍可以参照下面的链接后者百度下找找。2 新建一个模块,输入下面的代码。Sub SaveAsMacroEnable() Dim OldFileName As String OldFileName = Left(ThisWorkbook.FullName, InStr(ThisWorkbook.FullName, ".") - 1) ActiveWorkbook.SaveAs...
save as是另存。1.如图所示,出现如图的对话框,点击否。2.选择Excel保存的类型,点击Excel启用宏的工作簿.xlsm。3.打开Excel,点击开发工具——宏,这时就能发现ExcelVBA被保存了。4.点击执行,就能执行录制的宏代码了,效果如图所示。5.当然也可以通过文件——另存为——文件格式为启用宏的工作簿.xl...
SaveAs(FileName,FileFormat,Password,WriteResPassword,ReadOnlyRecommended,CreateBackup,AccessMode,ConflictResolution,AddToMru,TextCodepage,TextVisualLayout,Local)参数Filename可选,表示要保存文件的文件名的字符串。可包含完整路径,如果不指定路径,将文件保存到当前文件夹中。使用SaveAs方法将工作簿另存为新文件后...
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & "文件名", FileFormat:=xlWorkbookNormal 另存为xls的工作簿 'ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & "文件名", FileFormat:=xlExcel8 另存为PDF ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ThisWorkbook.Pat...
Saveas 是把当前文件另存为另一个文件,所以"当前"文件就变成目标文件了,想要做一个备份,而真正的保留当前文件,请使用 SaveCopyAs,这样才可以达到楼主的目的...即:把 ThisWorkbook.SaveAs ("d:\temp\temp全省站点名单1.xls") 改为:ThisWorkbook.SaveCopyAs ("d:\temp\temp全省站点名单1.xls")Workboo...
Since Excel 2010, it has been possible to save Excel as PDF. The PDF format was then and continues to be, one of the most common file formats for distributing documents. The code examples below provide the VBA macros to automate the creation of PDFs from Excel using the ExportAsFixedFormat...
Save As a File on the Current Location By default, VBA uses the current location to save the file. When you write code with the SAVE AS method and just specify the name that file straight goes to the current folder. You can see in the following code where you have the which saves the...
E盘 或 E:\收据\ 这个目录不存在 问题补充:“工具”菜单下“选项”对话框“安全性”选项卡中的“保存时从文件属性中删除个人信息”不要选中就没提示了 1