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 6195163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:25:14+00:00 2026-05-24T03:25:14+00:00

I have one simple problem when trying to write List into the excel workbook.

  • 0

I have one simple problem when trying to write List into the excel workbook. on string its work perfect but problem is how i can put list into excel

public List<string> _RoomType = new List<string>();
Excel.Range RoomType = (Excel.Range)_sheet.get_Range(_sheet.Cells[22, "B"] as Excel.Range, _sheet.Cells[25, "B"] as Excel.Range);
 for (int i = 0; i < _RoomType.Count; i++)
            {
                RoomType.set_Value(Type.Missing, _RoomType[i]);

if im using for loop it sets from 22B to 25B only first value which is in list
and if i dont use ‘for’ visual studio gives me exception : Exception from HRESULT: 0x800A03EC
can anyone help me?

  • 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-24T03:25:15+00:00Added an answer on May 24, 2026 at 3:25 am

    You need to pass a 2-dimensional array to the set_Value method. You have to make sure though that number of items in your list equals the number of cells in your range.

    Object[,] dataArray = new object[1, _RoomType.Count];
    for (int i = 0; i < _RoomType.Count; i++)
    {
       dataArray[0, i] = _RoomType[i];
    }
    RoomType.set_Value(Type.Missing, dataArray);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a simple problem in SQLAlchemy. I have one model in a table,
I have a PHP file with one simple echo function: echo 'アクセスは撥ねりません。'; but when
Im sure this will be a simple one but have a project that started
I am modifying a wordpress theme completely, and have run into one very simple
I'm trying to style an ordered list that seemed quite simple but apparently is
I know zero javascript, and have one simple task: Find all text in the
I have a simple one-to-many relationship. I would like to select rows from the
A simple example: Let's say I have one alias being sourced somewhere as: alias
I've been looking for a simple regex for URLs, does anybody have one handy
When I'm testing my simple geometric library, I usually have one or two methods

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.