Results 1 to 6 of 6

Thread: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    165

    Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED

    Hello,
    I am working with Visual Studio 2005 using vb.net to create a windows application, I am getting the following error:
    Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))
    on the following line of code:
    oSheet.cells(rowcount + 2 + i, j + colstart).value = repdata.Rows(i).Item(j)

    In my code i am trying to create a report in excel by looping over a datatable and writing its content to the excel sheet.

    Any idea? Thank you in advance.

    Hiba

  2. #2
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED

    We'll need to see more code than that to see what you're doing wrong. Please post the whole function block. Please remember to use [CODE] tags around the code so it is formatted properly on here.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    165

    Re: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED

    Hello, This is a function in a class called reports that is called to write the datatable to the excel sheet.
    Code:
    Public Function SetDTable(ByVal repdata As DataTable, ByVal dinput As ArrayList, ByVal rowcount As Integer, ByVal sn As Boolean, ByVal recap As Boolean) As Boolean
            'write the data header from the arraylist 
            Dim k As Integer = 0
            Dim result As Boolean
    
            If recap = True Then
                rowcount = rowcount + 1
            End If 'recap
            'writing the header of the report
            If dinput IsNot Nothing Then
                For k = 0 To dinput.Count - 1
                    oSheet.cells(rowcount + 1, k + 1).value = dinput(k)
                    oSheet.cells(rowcount + 1, k + 1).Font.Bold = True
                Next
            End If 'hdr
    
            Dim i As Integer = 0
            Dim j As Integer = 0
            Dim colstart As Integer = 0
    
            If repdata.Rows.Count > 0 Then
                'SN 
                If recap = True Then
                    colstart = 1
                Else
                    If sn = True Then
                        SNnumbering(rowcount + 2, repdata.Rows.Count, oSheet)
                        colstart = 2 'B
                    Else
                        colstart = 1 'A
                    End If
                End If 'recap
    
                'write the data by looping over the datatable
                For i = 0 To repdata.Rows.Count - 1
                    For j = 0 To repdata.Columns.Count - 1
                        oSheet.cells(rowcount + 2 + i, j + colstart).value = repdata.Rows(i).Item(j)
                    Next
                Next
                'set data borders
                SetBorders(rowcount + 1, 1, (repdata.Rows.Count + rowcount + 1), colstart + (repdata.Columns.Count - 1), repdata.Rows.Count, oSheet)
    
                With oSheet
                    .Range(.cells((rowcount + 1), 1), .cells((repdata.Rows.Count + rowcount + 1), dinput.Count)).HorizontalAlignment = Constants.xlhAlignCenter
                End With
    
                result = True
            Else
                result = False
            End If
            Return result
        End Function
    Hope u can help. thnx
    Hiba

  4. #4
    New Member
    Join Date
    Aug 2008
    Posts
    8

    Question Re: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJE

    Did you manage to find the solution for this issue? I have exactly the same situation.

  5. #5
    Member
    Join Date
    Jul 2004
    Posts
    35

    Re: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJE

    I too have the exact same problem ... and banging my head against the wall.

    Few specifics:
    My vb.net app is exporting values to excel whenever necessary (i.e. once every few minutes). Using Excel 2007 on WinXp Pro, with VS2010 in my case ... but VS2008 did same thing.


    I do this once on startup ...
    Code:
                ' start excel application      
                oXL = New Excel.Application
                oXL.Visible = True
    
                ' Get a new workbook.       
                oWB = frmMain.oXL.Workbooks.Open(frmMain.ExcelFileName, True, False)
                oSheet = frmMain.oWB.ActiveSheet
    ... then I call this whenever my program is ready to export something to excel ...

    Code:
        Private Sub ExportToExcel(ByVal Row As Integer, ByVal Column As Integer, ByVal text As String)
            Try
                oSheet.Cells(Row, Column) = text
            Catch ex As Exception
                ExceptionMsg("Crashed in ExportToExcel", ex)
            End Try
        End Sub
    .... what's more confusing, is this this DOES sometimes work, sometimes not within the same few minutes. It really appears random if it's going to work or not when I call this sub.

  6. #6
    New Member
    Join Date
    Oct 2011
    Posts
    1

    Re: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJE

    Quote Originally Posted by hiba84 View Post
    Hello,
    I am working with Visual Studio 2005 using vb.net to create a windows application, I am getting the following error:
    Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))
    on the following line of code:
    oSheet.cells(rowcount + 2 + i, j + colstart).value = repdata.Rows(i).Item(j)

    In my code i am trying to create a report in excel by looping over a datatable and writing its content to the excel sheet.

    Any idea? Thank you in advance.

    Hiba
    Hi,

    I have encountered the same error coming from c# through interop:

    xlApp = new Microsoft.Office.Interop.Excel.Application();
    int count_addins = xlApp.AddIns.Count;

    Did you find any solution to this?

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width