I am using a function to add excelsheet to excelbook (passing excelbook object as reference). (For dynalic insertion of excel sheets in book , i am updating iNumber)
Public Function AddExcelSheet( ByRef Xlb As Object, Optional ByVal sWorkBookName As String = "") As Object
Dim Xlsw As Excel.Worksheet
Xlsw = CType(Xlb.worksheets(iNumber), Excel.Worksheet)
iNumber = iNumber + 1
Xlsw.Name = sWorkBookName
Return Xlsw
End Function
but when i calling this function, I am getting exception "The RPC Server is unavaliable" for line
Xlsw = CType(Xlb.worksheets(iNumber), Excel.Worksheet)
Can anyone please throw light on this
regards,
Deepthi
Public Function AddExcelSheet( ByRef Xlb As Object, Optional ByVal sWorkBookName As String = "") As Object
Dim Xlsw As Excel.Worksheet
Xlsw = CType(Xlb.worksheets(iNumber), Excel.Worksheet)
iNumber = iNumber + 1
Xlsw.Name = sWorkBookName
Return Xlsw
End Function
but when i calling this function, I am getting exception "The RPC Server is unavaliable" for line
Xlsw = CType(Xlb.worksheets(iNumber), Excel.Worksheet)
Can anyone please throw light on this
regards,
Deepthi