Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple error with a vbscript file

Status
Not open for further replies.

naikadit

Technical User
Jun 30, 2008
22
US
hi guys I am newbie in vbscript I am running a code to check if there are any decimal values in ab dyn RN but I am getting an erro type mismatch for the line p=inst......

Can you guys plesae help me


Set objSheet = objExcel.ActiveWorkbook.Worksheets("dyn RN")
dim p,q ,r, isFloat3, toTest3, xlup2, nmaxrow2
xlup2=&HFFFFEFBE
nmaxrow2=objSheet.range("a65536").end(xlup2).row
objExcel.ActiveWorkbook.Worksheets("dyn RN").Range("A1:BI"&nmaxrow2).Value = objExcel.ActiveWorkbook.Worksheets("dyn RN").Range("A1:BI"&nmaxrow2).Value


isfloat3=false
toTest3 = "hello"
p=0
For q= 2 to nmaxrow2
For r=1 to 12

toTest3 = objExcel.ActiveWorkbook.Worksheets("dyn RN").cells(q,r).Value
p=instr(1,toTest3,".",vbTextCompare)----- here is the error
if p>0 and r <>9 and r<> 11 then
isFloat3=true
objtxtStream.Writeline "Decimal number in dyn RN - Row: " & q & " Column : " & r
end If
Next
Next
 
What about this ?
toTest3 = objExcel.ActiveWorkbook.Worksheets("dyn RN").Cells(q,r).Text
p=InStr(toTest3,".")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
hi thanks.. but i still get that error type mismatch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top