<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: dwg file in the excel file in c # winform transfer in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3927357#M49742</link>
    <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;thank you very much&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But data in dwg file&lt;/P&gt;</description>
    <pubDate>Sat, 18 May 2013 08:49:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-05-18T08:49:21Z</dc:date>
    <item>
      <title>dwg file in the excel file in c # winform transfer</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3904592#M49736</link>
      <description>&lt;P&gt;&amp;nbsp;How can I&amp;nbsp;dwg file in the excel file in c # winform transfer?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good Times&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2013 10:31:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3904592#M49736</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-03T10:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: dwg file in the excel file in c # winform transfer</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3904846#M49737</link>
      <description>Try language translator please:&lt;BR /&gt;&lt;A target="_blank" href="http://translate.google.com/"&gt;http://translate.google.com/&lt;/A&gt;</description>
      <pubDate>Fri, 03 May 2013 12:03:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3904846#M49737</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2013-05-03T12:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: dwg file in the excel file in c # winform transfer</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3905046#M49740</link>
      <description>&lt;P&gt;Sorry for translation&lt;/P&gt;&lt;P&gt;new post:&lt;A target="_blank" href="https://forums.autodesk.com/t5/NET/reading-some-variables-into-DWG-file-how-C/m-p/3905039"&gt;http://forums.autodesk.com/t5/NET/reading-some-variables-into-DWG-file-how-C/m-p/3905039&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2013 13:15:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3905046#M49740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-03T13:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: dwg file in the excel file in c # winform transfer</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3905393#M49741</link>
      <description>&lt;P&gt;Ok, that make a sence,&lt;/P&gt;&lt;P&gt;then try this code, but change before Excel file name,&lt;/P&gt;&lt;P&gt;shhet name and range address:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Require references to:
Microsoft Excel 12.0 Object Library
and
Microsoft Office 12.0 Object Library
//--------------------------------------------//
#region "Imports"
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Interop.Excel;
using Excel = Microsoft.Office.Interop.Excel;
using System.Windows.Forms;
#endregion

     public static void ReadExcel()
        {
            // set file name to read:
            string xlFileName = @"c:\Test\dummy.xls";
            Excel.Application xlApp;
            Excel.Workbook xlBook;
            Excel.Sheets xlSheets;
            Excel.Worksheet xlSheet;
            Excel.Range xlRange;
            // get Excel application
            xlApp = new Excel.Application();

            xlApp.Visible = false;
            object miss = Type.Missing;
            StringBuilder sb = new StringBuilder();
            try
            {
                // try open workbook as read-only
                xlApp.Workbooks.Open(xlFileName, false, true, miss, miss, miss, miss, miss, miss, miss, miss, miss, miss, miss, miss);
                xlBook = xlApp.ActiveWorkbook;
                xlBook.Saved = true;
                xlApp.DisplayAlerts = false;
                xlSheets = xlBook.Worksheets;
                // few ways to get an Excel sheet
                // get sheet by name:
                // xlSheet = (Excel.Worksheet)xlSheets.Item["Big Sheet"];
                // get sheet by index:
                xlSheet = (Excel.Worksheet)xlSheets.Item[1];
                // get sheet by name:
                // xlSheet = (Excel.Worksheet)xlSheets.get_Item("Big Sheet");
                 // get sheet by index:
                // xlSheet = (Excel.Worksheet)xlSheets.get_Item(1);
                // few ways to get an Excel range
                // xlRange = (Excel.Range)xlSheet.Range[xlSheet.Cells[1, 1], xlSheet.Cells[5, 6]]; 
                // the same as:
                xlRange = (Excel.Range)xlSheet.Range["A1:F5"];//	&amp;lt;-- change range address here
                // read the whole range:
                //object[,] varr = (object[,])xlRange.Value2;
                // the same as:
                object[,] varr = (object[,])xlRange.Value;
                // get sizes of arrary:
                int i = varr.GetUpperBound(0);
                int j = varr.GetUpperBound(1);
                // loop thru array
                for (int a = 0; a &amp;lt; i; a++)
                {
                    Excel.Range xlCell;

                    string cell = "";
                    for (int b = 0; b &amp;lt; j; b++)
                    {
                        //cell index in Excel is non zero-based and starts from 1 
                        xlCell = (Excel.Range)xlRange.Item[a + 1, b + 1];
                        cell = cell + xlCell.Value.ToString() + "\t";
                    }
                    // populate stringbuilder
                    sb.AppendLine(cell);
                }


            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);

            }
            finally
            {
                // close all workbooks
                xlApp.Workbooks.Close();
                // quit application
                xlApp.Quit();
                MessageBox.Show(sb.ToString());
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2013 14:36:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3905393#M49741</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2013-05-03T14:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: dwg file in the excel file in c # winform transfer</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3927357#M49742</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;thank you very much&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But data in dwg file&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2013 08:49:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3927357#M49742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-18T08:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: dwg file in the excel file in c # winform transfer</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3933422#M49743</link>
      <description>&lt;P&gt;I have replied to your other post on this topic. The code snippet that I have posted is very minimal and you can get more details on using the Excel API from code snippet that Hallex has shared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/NET/I-want-to-read-data-from-a-DWG-excel-file-using-C/m-p/3933417#M35145" target="_blank"&gt;http://forums.autodesk.com/t5/NET/I-want-to-read-data-from-a-DWG-excel-file-using-C/m-p/3933417#M35145&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2013 11:34:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-file-in-the-excel-file-in-c-winform-transfer/m-p/3933422#M49743</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2013-05-23T11:34:51Z</dc:date>
    </item>
  </channel>
</rss>

