简体   繁体   English

如何使用 vbs 脚本复制活动的 Excel 工作表并将其保存到新工作簿中?

[英]How to copy an active excel sheet and save it into a new workbook using a vbs script?

I'm trying to copy an excel sheet that includes formulas and paste it into a new excel workbook as values and retaining the format using vbs script.我正在尝试复制一个包含公式的 Excel 工作表,并将其作为值粘贴到一个新的 Excel 工作簿中,并使用 vbs 脚本保留格式。

I'm currently doing it but instead of copying I'm saving it as a CSV.我目前正在这样做,但不是复制,而是将其另存为 CSV。 So it is only saving the first page but it looses the format.所以它只保存了第一页,但它失去了格式。

Please help.请帮忙。 Thank you.谢谢你。

I found a way around to fix this, I run a vbs to refresh and save the file.我找到了解决此问题的方法,我运行 vbs 来刷新并保存文件。 then with a batch file i run another script and open the file to only run a macro inside of it and the macro does the job.然后使用批处理文件,我运行另一个脚本并打开该文件,只在其中运行一个宏,宏完成这项工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM