Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要以编程方式导出 csv 格式的文件。我添加了以下在用户单击按钮时调用的函数:
Public Sub CreateCVS() ActiveWorkbook.SaveAs Filename:="filename.csv", _ FileFormat:=xlCSV, CreateBackup:=False End Sub
问题是我不想保存我的文件,我想以 csv 格式导出它,但电子表格仍然应该是一个 xlsm 文件。
可能吗
只需先导出工作表
Public Sub CreateCVS() activesheet.copy ActiveWorkbook.SaveAs Filename:="filename.csv", _ FileFormat:=xlCSV, CreateBackup:=False activeworkbook.close false End Sub