1 ) Because Excel.Application is bad. It is resource intensive, creates one or more a running instances of Excel on our server. I am not going that route. Using COM is much more efficient.
can this be done in a one liner without using a With statment?
objSpreadsheet.Cells(p,1).
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Main Topics
Browse All Topics





by: p_siePosted on 2004-04-28 at 09:41:13ID: 10941073
1 Why not use Set objSpreadsheet = Server.CreateObject("Excel .Applicati on")
Select
Select
2
objSpreadsheet.Cells(p,1).
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
3 objSpreadsheet.Cells(p,1).
Selection.Font.ColorIndex = 3 (3 = red)
You can get these codes by recording a macro in Excel and then look at the code