<?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 .net excel cell format border in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/net-excel-cell-format-border/m-p/8915005#M99746</link>
    <description>&lt;P&gt;I am using Inventor 2019.4 &amp;amp; MS visual studio express 2017. My code is making a report of Custom Content progress via excel.&amp;nbsp; All formatting&amp;nbsp; calls work, except for putting a bottom border on. Even the border call ".includeborder" works. I am relatively new to .net and don't know if there's something wrong in the code, or if I'm not using the right command. Do you have any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. the section is between =\/= &amp;amp; =/\=.&amp;nbsp; Also note the many failed attempts in red. sorry for the slop.&lt;/P&gt;&lt;PRE&gt;Imports System
Imports System.Type
Imports System.Activator
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Core
Imports Excel = Microsoft.Office.Interop.Excel
Imports Inventor

    Private Sub ListToExcel(ByVal CCArray() As ReportObject)

        'create a new excel
        Dim XlApp As Excel.Application = CreateObject("Excel.Application")
        XlApp.Visible = True

        'create a new workbook in excel
        Dim XlBook As Excel.Workbook = XlApp.Workbooks.Add()

        'gets the active worksheet in excel
        Dim XlSheet As Excel.Worksheet = CType(XlBook.ActiveSheet, Excel.Worksheet)

        'create a range
        Dim RepRange As Excel.Range = XlSheet.Range("A1")
&lt;FONT size="4" color="#FF6600"&gt;'==\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/==&lt;/FONT&gt;
        'create node cell style
        Dim NodeStyle As Excel.Style = XlSheet.Application.ActiveWorkbook.Styles.Add("_CBNodeStyle")
        &lt;FONT color="#FF0000"&gt;'NodeStyle.Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).Weight = Excel.XlBorderWeight.xlThick
        'NodeStyle.Borders.Value(Excel.XlBordersIndex.xlEdgeBottom) = Excel.XlBorderWeight.xlThick)
        'NodeStyle.Borders.Value = Excel.XlBordersIndex.xlEdgeBottom
        'NodeStyle.Borders(xlEdgeBottom).LineStyle = xlContinuous&lt;/FONT&gt;
        'MsgBox(NodeStyle.Borders._Default(Excel.XlBordersIndex.xlEdgeBottom))
        &lt;FONT color="#FF0000"&gt;'NodeStyle.Borders(9).LineStyle = Excel.XlLineStyle.xlContinuous
        'NodeStyle.Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlContinuous
        'NodeStyle.Borders(Excel.XlBordersIndex.xlEdgeBottom) = True
        'XlSheet.UsedRange.Borders.LineStyle = Excel.XlLineStyle.xlContinuous
        'NodeStyle.IncludeBorder = Excel.XlBordersIndex.xlEdgeBottom
        'NodeStyle.Borders.Weight = Excel.XlBorderWeight.xlThick
        'NodeStyle.Borders.LineStyle = Excel.XlLineStyle.xlContinuous&lt;/FONT&gt;
        NodeStyle.Font.Italic = True
        NodeStyle.Font.Size = 14
        NodeStyle.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.LightSkyBlue)
        'NodeStyle.Interior.Color = RGB(0, 176, 240)
&lt;FONT size="4" color="#FF6600"&gt;'==/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\==&lt;/FONT&gt;
        'create default family cell style
        Dim FamStyle As Excel.Style = XlSheet.Application.ActiveWorkbook.Styles.Add("_CBFamStyle")
        FamStyle.Borders.Item(Excel.XlBordersIndex.xlEdgeLeft).Weight = Excel.XlBorderWeight.xlMedium
        NodeStyle.Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Black)
        FamStyle.Font.Bold = True
        FamStyle.Font.Size = 12
        FamStyle.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Orange)

        'create finished family cell style
        Dim FinFamStyle As Excel.Style = XlSheet.Application.ActiveWorkbook.Styles.Add("_CBFinFamStyle")
        FinFamStyle.Borders.Item(Excel.XlBordersIndex.xlEdgeLeft).Weight = Excel.XlBorderWeight.xlMedium
        NodeStyle.Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Black)
        FinFamStyle.Font.Bold = True
        FinFamStyle.Font.Size = 12
        FinFamStyle.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Lime)


        'width of columns
        XlSheet.Columns.AutoFit()

        'loop each object in the array
        For Each RepObj In CCArray
            'if the type is "N" for node then
            If RepObj.ReportType = "N" Then
                'gets the cell of the current object
                RepRange = XlSheet.Range(RepObj.ReportColumn &amp;amp; RepObj.ReportRow + 1)
                'set the cell style
                RepRange.Style = NodeStyle
&lt;FONT color="#FF0000"&gt;                'RepRange.Style.Borders(Excel.XlBordersIndex.xlEdgeBottom).linetype = Excel.XlLineStyle.xlContinuous&lt;/FONT&gt;
                'fill in the cell value
                RepRange.Value = RepObj.ReportName
            ElseIf RepObj.ReportType = "F" And RepObj.ReportDesc.Substring(RepObj.ReportDesc.ToString, 3) = "_CB-" Then
                'gets the cell of the current object
                RepRange = XlSheet.Range(RepObj.ReportColumn &amp;amp; RepObj.ReportRow + 1)
                'set the cell style
                RepRange.Style = FinFamStyle
                'fill in the cell value
                RepRange.Value = RepObj.ReportName
            Else
                'gets the cell of the current object
                RepRange = XlSheet.Range(RepObj.ReportColumn &amp;amp; RepObj.ReportRow + 1)
                'set the cell style
                RepRange.Style = FamStyle
                'fill in the cell value
                RepRange.Value = RepObj.ReportName
            End If



        Next

        XlApp = Nothing
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2019 16:19:11 GMT</pubDate>
    <dc:creator>snappyjazz</dc:creator>
    <dc:date>2019-07-17T16:19:11Z</dc:date>
    <item>
      <title>.net excel cell format border</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/net-excel-cell-format-border/m-p/8915005#M99746</link>
      <description>&lt;P&gt;I am using Inventor 2019.4 &amp;amp; MS visual studio express 2017. My code is making a report of Custom Content progress via excel.&amp;nbsp; All formatting&amp;nbsp; calls work, except for putting a bottom border on. Even the border call ".includeborder" works. I am relatively new to .net and don't know if there's something wrong in the code, or if I'm not using the right command. Do you have any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. the section is between =\/= &amp;amp; =/\=.&amp;nbsp; Also note the many failed attempts in red. sorry for the slop.&lt;/P&gt;&lt;PRE&gt;Imports System
Imports System.Type
Imports System.Activator
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Core
Imports Excel = Microsoft.Office.Interop.Excel
Imports Inventor

    Private Sub ListToExcel(ByVal CCArray() As ReportObject)

        'create a new excel
        Dim XlApp As Excel.Application = CreateObject("Excel.Application")
        XlApp.Visible = True

        'create a new workbook in excel
        Dim XlBook As Excel.Workbook = XlApp.Workbooks.Add()

        'gets the active worksheet in excel
        Dim XlSheet As Excel.Worksheet = CType(XlBook.ActiveSheet, Excel.Worksheet)

        'create a range
        Dim RepRange As Excel.Range = XlSheet.Range("A1")
&lt;FONT size="4" color="#FF6600"&gt;'==\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/==&lt;/FONT&gt;
        'create node cell style
        Dim NodeStyle As Excel.Style = XlSheet.Application.ActiveWorkbook.Styles.Add("_CBNodeStyle")
        &lt;FONT color="#FF0000"&gt;'NodeStyle.Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).Weight = Excel.XlBorderWeight.xlThick
        'NodeStyle.Borders.Value(Excel.XlBordersIndex.xlEdgeBottom) = Excel.XlBorderWeight.xlThick)
        'NodeStyle.Borders.Value = Excel.XlBordersIndex.xlEdgeBottom
        'NodeStyle.Borders(xlEdgeBottom).LineStyle = xlContinuous&lt;/FONT&gt;
        'MsgBox(NodeStyle.Borders._Default(Excel.XlBordersIndex.xlEdgeBottom))
        &lt;FONT color="#FF0000"&gt;'NodeStyle.Borders(9).LineStyle = Excel.XlLineStyle.xlContinuous
        'NodeStyle.Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlContinuous
        'NodeStyle.Borders(Excel.XlBordersIndex.xlEdgeBottom) = True
        'XlSheet.UsedRange.Borders.LineStyle = Excel.XlLineStyle.xlContinuous
        'NodeStyle.IncludeBorder = Excel.XlBordersIndex.xlEdgeBottom
        'NodeStyle.Borders.Weight = Excel.XlBorderWeight.xlThick
        'NodeStyle.Borders.LineStyle = Excel.XlLineStyle.xlContinuous&lt;/FONT&gt;
        NodeStyle.Font.Italic = True
        NodeStyle.Font.Size = 14
        NodeStyle.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.LightSkyBlue)
        'NodeStyle.Interior.Color = RGB(0, 176, 240)
&lt;FONT size="4" color="#FF6600"&gt;'==/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\=/\==&lt;/FONT&gt;
        'create default family cell style
        Dim FamStyle As Excel.Style = XlSheet.Application.ActiveWorkbook.Styles.Add("_CBFamStyle")
        FamStyle.Borders.Item(Excel.XlBordersIndex.xlEdgeLeft).Weight = Excel.XlBorderWeight.xlMedium
        NodeStyle.Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Black)
        FamStyle.Font.Bold = True
        FamStyle.Font.Size = 12
        FamStyle.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Orange)

        'create finished family cell style
        Dim FinFamStyle As Excel.Style = XlSheet.Application.ActiveWorkbook.Styles.Add("_CBFinFamStyle")
        FinFamStyle.Borders.Item(Excel.XlBordersIndex.xlEdgeLeft).Weight = Excel.XlBorderWeight.xlMedium
        NodeStyle.Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Black)
        FinFamStyle.Font.Bold = True
        FinFamStyle.Font.Size = 12
        FinFamStyle.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Lime)


        'width of columns
        XlSheet.Columns.AutoFit()

        'loop each object in the array
        For Each RepObj In CCArray
            'if the type is "N" for node then
            If RepObj.ReportType = "N" Then
                'gets the cell of the current object
                RepRange = XlSheet.Range(RepObj.ReportColumn &amp;amp; RepObj.ReportRow + 1)
                'set the cell style
                RepRange.Style = NodeStyle
&lt;FONT color="#FF0000"&gt;                'RepRange.Style.Borders(Excel.XlBordersIndex.xlEdgeBottom).linetype = Excel.XlLineStyle.xlContinuous&lt;/FONT&gt;
                'fill in the cell value
                RepRange.Value = RepObj.ReportName
            ElseIf RepObj.ReportType = "F" And RepObj.ReportDesc.Substring(RepObj.ReportDesc.ToString, 3) = "_CB-" Then
                'gets the cell of the current object
                RepRange = XlSheet.Range(RepObj.ReportColumn &amp;amp; RepObj.ReportRow + 1)
                'set the cell style
                RepRange.Style = FinFamStyle
                'fill in the cell value
                RepRange.Value = RepObj.ReportName
            Else
                'gets the cell of the current object
                RepRange = XlSheet.Range(RepObj.ReportColumn &amp;amp; RepObj.ReportRow + 1)
                'set the cell style
                RepRange.Style = FamStyle
                'fill in the cell value
                RepRange.Value = RepObj.ReportName
            End If



        Next

        XlApp = Nothing
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 16:19:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/net-excel-cell-format-border/m-p/8915005#M99746</guid>
      <dc:creator>snappyjazz</dc:creator>
      <dc:date>2019-07-17T16:19:11Z</dc:date>
    </item>
  </channel>
</rss>

