Error at $WorkSheet_Select Function

Error at $WorkSheet_Select Function

I wrote folowing code to select one of sheet in the Excel workbook, but I got "Severe Error(157) , Programing Exception, Access Violation" Message.
I couldn't find where y made mistake.
Is there anybody to help me, please?

status = VariantClear(vBSTR1)
bstr1 = 0

vInt%VT = VT_I4
vInt%VU%LONG_VAL = 1
CALL VariantInit(vBSTR1)
vBSTR1%VT = VT_BSTR
bstr1 = ConvertStringToBSTR("ABCD")
! "ABCD" is name of worksheet to be selected.
vBSTR1%VU%PTR_VAL = bstr1
call $Worksheet_Select(worksheet,vBSTR1,$status=status)

1 条帖子 / 0 全新
如需更全面地了解编译器优化,请参阅优化注意事项