我正在尝试编写一些VBA来打开excel文件,输入密码,只读=否,然后运行我的宏,保存,关闭...
除了“密码”部分,我一切都很好。我无法使该VBA正确执行VBA任务!!!
(此示例的密码为“ pw”)
Dim objExcel
Set objExcel = CreateObject("Excel.Application")
objExcel.workbooks.open("C:\users\bal01483\desktop\vb\book2.xlsm") **'(PLEASE HELP ME FIGURE OUT THE PASSWORD PIECE.)**
objExcel.Visible = True
objExcel.Run "helloworld"
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close(0)
objExcel.Quit