Macro to tag generated files

时间:2016-08-31 12:33:51

标签: excel-vba vba excel

I have written a macro in an Excel file to create and save to a specific folder another Excel file. Is there any way to tag the generated file, so that the tag are visible in Windows Explorer while browsing the folder where the files are saved?

1 个答案:

答案 0 :(得分:0)

您可以使用'// workbook must be open Set targetWorkbook = Workbooks("My Workbook.xlsx") '// add a comment to the workbook targetWorkbook.BuiltInDocumentProperties("Comments").Value = "my comment" '// save the workbook targetWorkbook.SaveAs "C:\Workbooks\My Saved Workbook.xlsx", xlOpenXMLWorkbook 集合添加注释,也可以在Windows资源管理器中搜索:

[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]

该工作簿现在将评论"我的评论"可以在Windows资源管理器中搜索。