[英]Check if Excel workbook is open using VBScript
I have a vbs script which writes to an Excel spreadsheet. 我有一个写入Excel电子表格的vbs脚本。 To be able to save the spreadsheet I need to ensure that it is not already open.
为了能够保存电子表格,我需要确保它尚未打开。
Can someone suggest the best way to do this? 有人可以建议最好的方法吗?
Some research: 有些研究:
Any other ideas? 还有其他想法吗?
Since the Excel.Application object doesn't give you access to all instances of Excel, what about using a simple error trap? 由于Excel.Application对象不允许您访问Excel的所有实例,因此使用简单的错误陷阱呢? ie.
即。 if it is unable to save the file, throw a warning message, save as another file name, etc.
如果无法保存文件,则抛出警告消息,另存为其他文件名等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.