Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8692057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:14:32+00:00 2026-06-13T00:14:32+00:00

I keep getting ‘Exception from HRESULT: 0x800A03EC’ error when I run my code. Some

  • 0

I keep getting ‘Exception from HRESULT: 0x800A03EC’ error when I run my code.
Some forums say that the ‘1’ needs to be changed to a ‘0’ or vice versa.
At this point I just don’t know what is wrong nothing is sticking out. I believe I have all the references loaded that I need, so any suggestions/help would be much appreciated.

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Dim objExcel As New Excel.Application
    Dim bkWorkBook As Workbook
    Dim shWorkSheet As Worksheet
    Dim i As Integer
    Dim j As Integer

    objExcel = New Excel.Application
    bkWorkBook = objExcel.Workbooks.Add
    shWorkSheet = bkWorkBook.ActiveSheet
    For i = 0 To Me.ListView1.Columns.Count
        shWorkSheet.Cells(1, Chr(64 + i)) = Me.ListView1.Columns(i)
    Next
    For i = 1 To Me.ListView1.Items.Count
        shWorkSheet.Cells(i + 2, "A") = Me.ListView1.Items(i).Text
        For j = 2 To Me.ListView1.Items.Count
            shWorkSheet.Cells(i + 2, Chr(64 + j)) = Me.ListView1.Items(i).SubItems(j - 1)
        Next
    Next

    objExcel.Visible = True
End Sub

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:14:33+00:00Added an answer on June 13, 2026 at 12:14 am

    I retested and found I hadn’t fully tested a listview with more than a couple of columns. Try this:

        Try
            Dim objExcel As New Excel.Application
            Dim bkWorkBook As Workbook
            Dim shWorkSheet As Worksheet
            Dim i As Integer
            Dim j As Integer
    
            objExcel = New Excel.Application
            bkWorkBook = objExcel.Workbooks.Add
            shWorkSheet = CType(bkWorkBook.ActiveSheet, Worksheet)
            For i = 0 To Me.ListView1.Columns.Count - 1
                shWorkSheet.Cells(1, i + 1) = Me.ListView1.Columns(i).Text
            Next
            For i = 0 To Me.ListView1.Items.Count - 1
                For j = 0 To Me.ListView1.Items(i).SubItems.Count - 1
                    shWorkSheet.Cells(i + 2, j + 1) = Me.ListView1.Items(i).SubItems(j).Text
                Next
            Next
    
            objExcel.Visible = True
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting a Run Time error that says I am having an Exception
I keep getting this whenever I run the below code: Fatal error: Call to
I keep getting this error from my code and I have no idea what
I keep getting this error when trying to run the code: (let ((exp lambda
I keep getting an error saying that @android:style/Widget.Holo.Light.Button.Borderless is not public and so can't
I keep getting this error on emulator: I copied this from a tutorial and
I keep getting this error with my Play 2.0 application: play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[MatchError:
I keep getting some weird error in Processing, using the following tiny piece of
Keep getting an error when I run the following. Any help greatly appreciated. John
I keep getting this error saying that it cannot find my javascript function checkpw().

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.