VBscript adding hyperlink to excel
The part of the code that is causing the issue is highlighted in bold:
Do Until objRecordSet.EOF
On Error resume next
If InStr(LCase(objRecordSet.Fields("OperatingSystem").Value),"server") Then
ObjXL.ActiveSheet.Cells(icount,1).Value = objRecordSet.Fields("Name").Value
ObjXL.ActiveSheet.Cells(icount,2).Value = objRecordSet.Fields("Location").Value
ObjXL.ActiveSheet.Cells(icount,3).Value = objRecordSet.Fields("OperatingSystem").Value
ObjXL.ActiveSheet.Cells(icount,4).Value = objRecordSet.Fields("operatingSystemServicePack").Value
ObjXL.Sheets.Add
ObjXL.ActiveSheet.Name =objRecordSet.Fields("Name").Value
ObjXL.Sheets("Sheet1").Select
objxl.activesheet.Hyperlinks.Add Anchor:= selection ObjXL.ActiveSheet.Cells("A1").select ,SubAddress:="sheet1!A1"
icount = icount + 1
End If
When I run this script it errors saying
Line 61
Char 42
error Expected statement
code 800A0400
source Miscrosoft VBScript Compilation error
Any help would be great

