I've spent days trying to get my Excel populated from ASP in an OCX and now it seems to turn out that Excel 2003 throws an error when using Replace if it is trying to Replace data that does not exist.
So I have this in for every report:
With xlSheet.Cells
.Replace What:="vbCRLF", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
.Replace What:="<*>", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End With
So if any report has imbedded any of the above text they get blown away and hence are not visible...works perfect in Excel 2000 on my machine....broken on Clients machine as it says Unable to Replace Data that does not exist...I assume other people have come accross this?!
So I have this in for every report:
With xlSheet.Cells
.Replace What:="vbCRLF", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
.Replace What:="<*>", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End With
So if any report has imbedded any of the above text they get blown away and hence are not visible...works perfect in Excel 2000 on my machine....broken on Clients machine as it says Unable to Replace Data that does not exist...I assume other people have come accross this?!