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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unknown runtime error 1

Status
Not open for further replies.

twooly

MIS
Joined
Feb 22, 2004
Messages
122
Location
US
Can some help me with this one. I am getting and Unknown runtime error. Here is the line it errors out at

objXL.Cells(count,1).Value = aSoftware


Here is the code

Set objXL = WScript.CreateObject("Excel.Application")
objXL.Visible = False
objXL.Workbooks.Add
objXL.DisplayAlerts = False
objXL.Worksheets(1).Name="Software List"
objXL.Cells(1,1).Value = "Application Name"
objXL.Cells(1,2).Value = "Install Count"
objXL.Range("A1:B1").Select
objXL.Selection.Font.Bold = True
objXL.Selection.Interior.ColorIndex = 9
objXL.Selection.Interior.Pattern = 1 'xlSolid
objXL.Selection.Font.ColorIndex = 2

For Each aSoftware In dicSoftware

objXL.Cells(count,1).Value = aSoftware
objXL.Cells(count,2).Value = dicSoftware.Item(aSoftware)
count = count + 1
Wscript.Echo aSoftware & "=" & dicSoftware.Item(aSoftware)

Next

I know there are values int eh dictonary object

Thanks
 
what is count the first time you go into your loop??/ i reckon it is 0, which isnt a row index in excel.

try adding a
count = 1 before you enter the loop

instead of worrying about creating an excel document why dont you write the results to a csv file and when you pipe the results to a csv file you add a ";" between the aSoftware and its value
 
Yep that was it. Thanks a bunch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top