Herman
Well-known member
I realize this may not be the best forum for this question, but I couldn't find a VBA forum around here, I figured I would ask anyways.
I am working on a test project with TestComplete that involves manipulating some Excel spreadsheets. The project uses VBScript and some helper object. I have written a new routine that reformats data from an existing spreadsheet and throws it in a new one.
I have two questions I have walked around for some time now. Have a look at the following snippet:
When execution comes to this part of the script, the script breaks at line 5 with an "Unknown runtime error.". I have tried various rewrites of the same line, nothing seems to work somehow. The syntax checker of the IDE reports nothing wrong.
My second question is in regards with the .Text property of cells in Excel. Through VBA, you can access that property which is a string containing the representation of the .Value property (what the user sees). That property does not seem to be available from VBScript (in fact there is no Cell class, operations are done on a Range class object...).
Any help would be appreciated.
I am working on a test project with TestComplete that involves manipulating some Excel spreadsheets. The project uses VBScript and some helper object. I have written a new routine that reformats data from an existing spreadsheet and throws it in a new one.
I have two questions I have walked around for some time now. Have a look at the following snippet:
CleanedUpExportedWorksheet = CleanedUpExportedWorksheet & objResult.Cells(nRow, nCol).Value & ";" objResult.Cells(nRow, nCol).Value = objSheet.Cells(currentRow, currentCol).Value If nCol = 1 then If Not CellRegExp.Test(objResult.Cells(nRow, nCol).Value) then objResult.Cells(nRow - 1, nCol).Value = objResult.Cells(nRow - 1, nCol).Value & _ " " & objResult.Cells(nRow, nCol).Value objResult.Rows(nRow).EntireRow.Delete End If End If
When execution comes to this part of the script, the script breaks at line 5 with an "Unknown runtime error.". I have tried various rewrites of the same line, nothing seems to work somehow. The syntax checker of the IDE reports nothing wrong.
My second question is in regards with the .Text property of cells in Excel. Through VBA, you can access that property which is a string containing the representation of the .Value property (what the user sees). That property does not seem to be available from VBScript (in fact there is no Cell class, operations are done on a Range class object...).
Any help would be appreciated.