I'm using typeof to determine the type of an object and keep getting an error that says: Argument 'Number' cannot be converted to a numeric value. The error occurs on bold line below.
vb Code:
[B]If TypeOf Str((CType(oShtData.Cells(2, 1), Excel.Range).Value)) Is String Then[/B] 'Copy variable names from the data worksheet. This data was imported form the CSV CType(oShtData.Rows(2), Excel.Range).Copy() 'Transpose and Paste the data into the Control worksheet CType(oShtCont.Cells(2, 8), Excel.Range).PasteSpecial(Excel.XlPasteType.xlPasteValues, , , True) End If
If I debug the this line it looks fine. The difference is that I cannot use ctype in the watch window.




Reply With Quote