Hi All,

Hi All,

I'm trying to execute a vbscript programme, on execution I'm getting following error, can you please help me in coming out of the problem.
"Wrong number of arguments or invalid property assignment: wsh"

CODE snippet:

Set xl=createobject("excel.application")
Set wb=xl.workbooks.open(testset)
xl.visible=true
Set wsh=wb.WorkSheets(1)  <------- ERROR is seen in this location

Thanks in Advance

Recommended Answers

wsh is reserved. If you execute the following line

wscript.echo wsh

the result will be the output of the line

Windows Script Host

use another variable name.

Jump to Post

All 2 Replies

wsh is reserved. If you execute the following line

wscript.echo wsh

the result will be the output of the line

Windows Script Host

use another variable name.

It worked.

Thanks a lot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.