I'm Looking for VBscript that will check to see if a specific Excel workbook is open and then run a macro, and in case if the workbook is close it will open the workbook.
i tried bellow code but it open the worbook as read only if the workbook is previously open.
when running the macro it will add 1 to cell F9, when running the macro via vbscript same workbook will open as read only and run the macro.
apreciate your help
i tried bellow code but it open the worbook as read only if the workbook is previously open.
when running the macro it will add 1 to cell F9, when running the macro via vbscript same workbook will open as read only and run the macro.
apreciate your help
Code:
Set xl = CreateObject("Excel.application")
xl.Application.Workbooks.open "C:\Users\redree\Desktop\project1.xlsm"
xl.Application.Visible = True
xl.Application.run "'project1.xlsm'!copy"
Set xl = Nothing
Comment