I'm using VBScript in a DTS Package with the Excel object to append data into an Excel spreadsheet. I've tested my code with MSVB 6.0, and it works fine. However, when I try running it through DTS, it gives me random errors. The weird thing is, these errors change depending on the state of the Excel spreadsheet. For instance, I'll run the DTS package, and it will give me an error:
Unable to set the Underline property of the Font class
If I run the exact same code through MSVB 6.0, it will work fine and append more data to the spreadsheet. If I then run the DTS package again, it will give me a different error, such as:
Object required: 'Selection'
This error occurs on the second line of the following code block:
wsObj.Range(wsObj.Cells(initCounter, "d"), wsObj.Cells(counter, "f")).Select
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
Every time I append more data to the excel spreadsheet, it either gives me random new errors, or recycles some of the old ones. I've made sure that excel.exe was not running every time I've executed the DTS package, and no programs had a lock on the file.