vijay.vizzu
Member
Dear All
Please find below code. I want to use this as Task Schedular script. So i saved this as .vbs. When i have first executed it, it works fine & next time it gives error like "The extract range has a missing or illegal field name." in the specified file. If i open that excel file and executive the macro "AdvanceFilter" it works. Why this error appears while executing through script file. I can't able to find out the error.
From last two days, i am scratching my head, but still can't resolve. So please help me to solve this
Below is my code which i am using it as script
[pre]
[/pre]
Regards
vijay
Please find below code. I want to use this as Task Schedular script. So i saved this as .vbs. When i have first executed it, it works fine & next time it gives error like "The extract range has a missing or illegal field name." in the specified file. If i open that excel file and executive the macro "AdvanceFilter" it works. Why this error appears while executing through script file. I can't able to find out the error.
From last two days, i am scratching my head, but still can't resolve. So please help me to solve this
Below is my code which i am using it as script
[pre]
Code:
' ================================================
dim objExcel,objFSO,objFolder,objFileName
set ObjExcel = createobject("excel.application")
set objFSO = createobject("scripting.filesystemobject")
set objFolder = objfso.getfolder("w:DPS 14-02-13TESTING")
for each objFilename in objfolder.files
objexcel.workbooks.open (objfilename)
objexcel.visible = false
objexcel.run "AdvanceFilter"
objexcel.run "ReadyReport"
objexcel.activeworkbook.close false
objexcel.quit
next
objexcel.workbooks.open("W:Quote PendencyQP.xlsm")
objexcel.visible = false
objexcel.run "extractData"
objexcel.activeworkbook.close false
objexcel.quit
Regards
vijay