on 07-29-2014 8:19 PM
I have a .vbs script which works great. When it runs it opens an Excel workbook in these lines:
Set xcl = CreateObject ("Excel.Application")
Set wbk = xcl.Workbooks.open("C:\Users\Barry\Desktop\Level3\Defects.xlsm")
Set sht - wbk.Sheets("Sheet1")
I want wbk to refer to the active workbook instead (i.e. Set wbk = ActiveWorkbook) but it doesn't like that, gives me "Object Required: ActiveWorkbook"
Please advise
Hi Stuart,
You can try the following:
set wbk = xcl.ActiveWorkbook
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.