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

  • Home
  • SEARCH
  • 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 6332843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:21:26+00:00 2026-05-24T18:21:26+00:00

Update2 Please see my answer to my question. Update So, I updated the code

  • 0

Update2

Please see my answer to my question.

Update

So, I updated the code per @Eddy comment below, however I’m still getting an error on the myRange = Globals.Sheet…line.

Dim xlDown, i As Int32
Dim myRange As Excel.Range

myRange = Globals.Sheet1.Application.Transpose(
                             Globals.Sheet1.Range(
                                 Globals.Sheet1.Range("A1"), 
                                 Globals.Sheet1.Range("A1").End(xlDown)).Value)

 For i = 1 To myRange.Rows.Count
      ListBox2.Items.Add(myRange.Cells(i, 1).Value)
 Next i

ERROR says:

System.RuntimeType.ForwaredCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData) at Microsoft.Office.Interop.Excel.Range.get_End(XlDirection
Direction)

Any Ideas?

Thanks again

———————————Orig Question————————————-

I have a VBA excel program that I’m converting to VB.net (using Visual Studio 2010) and I’m getting an error that I did not have in the old VBA version. The error occurs when I try to transpose the excel range to a listbox:

Property Items is readOnly

Within the With statment

Dim xlDown As Int32

With Globals.Sheet1
    ListBox2.Items = Globals.Sheet1.Application.Transpose(
                         Globals.Sheet1.Range(
                             Globals.Sheet1.Range("A1"), 
                             Globals.Sheet1.Range("A1").End(xlDown)).Value)
End With

I’m not sure what to do with this, maybe I’m not referencing the Globals.Sheet1 correctly?

Thank you

  • 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-05-24T18:21:27+00:00Added an answer on May 24, 2026 at 6:21 pm

    After doing some further research I figured out that I did not have to use the transpose method to assign the excel.range values to a listbox.

    Thank you to those who responded.

            Dim range As Excel.Range = Globals.Sheet1.UsedRange
            Dim obj As Object
    
            For rCnt = 1 To range.Rows.Count
                For cCnt = 1 To range.Columns.Count
                    obj = CType(range.Cells(rCnt, cCnt), Excel.Range)
                    ListBox1.Items.Add(obj.value)
                Next
            Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE: SOLVED!!! Please see the answer I added below Does anyone know if there
Please look at : http://news.bbc.co.uk/2/hi/europe/8592380.stm The content updates automatically, however, I can't see it
Update: Please read this question in the context of design principles, elegance, expression of
Please read my update at the end of question after reading the answers: I'm
Please, provide code examples in a language of your choice. Update : No constraints
**Updated: (See below)**I have been looking around for couple of days and can't find
UPDATE: I recently learned from this question that in the entire discussion below, I
(Re-written question, please see history for original). The question is right there in the
Question 828421 asked similar question, but received only one real answer (update rubygems) and
UPDATE: Focus your answers on hardware solutions please. What hardware/tools/add-in are you using to

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.