<?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: How to create a excel file using ilogic? Thanks in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518480#M135752</link>
    <description>&lt;P&gt;Hi MtigaM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To specify the template to use you can use this example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A target="_blank" href="http://inventortrenches.blogspot.com"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'define the file to create/open
myXLS_File = "C:\Temp\Best_Excel_File_Ever.xls"

‘get the Inventor user name from the Inventor Options
myName= ThisApplication.GeneralOptions.UserName

'define Excel Application object
excelApp = CreateObject("Excel.Application")
'set Excel to run visibly, change to false if you want to run it invisibly
excelApp.Visible = True
'suppress prompts (such as the compatibility checker)
excelApp.DisplayAlerts = false

'check for existing file 
If Dir(myXLS_File) &amp;lt;&amp;gt; "" Then
'workbook exists, open it
excelWorkbook = excelApp.Workbooks.Open(myXLS_File)
ExcelSheet = ExcelWorkbook.Worksheets(1)
Else
'create a new spreadsheet from template
&lt;STRONG&gt;excelWorkbook = excelApp.Workbooks.Add (Template: = "C:\Temp\Best_Excel_Template_Ever.xlt")&lt;/STRONG&gt;
End if

'Insert data into Excel.
With excelApp
	.Range("A1").Select
	.ActiveCell.FormulaR1C1 = "Hello, " &amp;amp; myName
End With   

'set all of the columns to autofit
excelApp.Columns.AutoFit   
'save the file
excelWorkbook.SaveAs (myXLS_File)

''close the workbook and the Excel Application
''uncomment if you want to close the xls file at the end
'excelWorkbook.Close
'excelApp.Quit
'excelApp = Nothing       &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jun 2012 18:54:55 GMT</pubDate>
    <dc:creator>Curtis_Waguespack</dc:creator>
    <dc:date>2012-06-27T18:54:55Z</dc:date>
    <item>
      <title>How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518240#M135748</link>
      <description />
      <pubDate>Wed, 27 Jun 2012 16:56:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518240#M135748</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-27T16:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518296#M135749</link>
      <description>&lt;P&gt;Hi MtigaM,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an iLogic example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A target="_blank" href="http://inventortrenches.blogspot.com"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'define the file to create/open&lt;BR /&gt;myXLS_File = "C:\Temp\Best_Excel_File_Ever.xls"&lt;BR /&gt;&lt;BR /&gt;‘get the Inventor user name from the Inventor Options&lt;BR /&gt;myName= ThisApplication.GeneralOptions.UserName&lt;BR /&gt;&lt;BR /&gt;'define Excel Application object&lt;BR /&gt;excelApp = CreateObject("Excel.Application")&lt;BR /&gt;'set Excel to run visibly, change to false if you want to run it invisibly&lt;BR /&gt;excelApp.Visible = True&lt;BR /&gt;'suppress prompts (such as the compatibility checker)&lt;BR /&gt;excelApp.DisplayAlerts = false&lt;BR /&gt;&lt;BR /&gt;'check for existing file &lt;BR /&gt;If Dir(myXLS_File) &amp;lt;&amp;gt; "" Then&lt;BR /&gt;'workbook exists, open it&lt;BR /&gt;excelWorkbook = excelApp.Workbooks.Open(myXLS_File)&lt;BR /&gt;ExcelSheet = ExcelWorkbook.Worksheets(1)&lt;BR /&gt;Else&lt;BR /&gt;'workbook does NOT exist, so create a new one&lt;BR /&gt;excelWorkbook = excelApp.Workbooks.Add&lt;BR /&gt;End if&lt;BR /&gt;&lt;BR /&gt;'Insert data into Excel.&lt;BR /&gt;With excelApp&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.Range("A1").Select&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.ActiveCell.FormulaR1C1 = "Hello, " &amp;amp; myName&lt;BR /&gt;End With&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;'set all of the columns to autofit&lt;BR /&gt;excelApp.Columns.AutoFit&amp;nbsp; &amp;nbsp;&lt;BR /&gt;'save the file&lt;BR /&gt;excelWorkbook.SaveAs (myXLS_File)&lt;BR /&gt;&lt;BR /&gt;''close the workbook and the Excel Application&lt;BR /&gt;''uncomment if you want to close the xls file at the end&lt;BR /&gt;'excelWorkbook.Close&lt;BR /&gt;'excelApp.Quit&lt;BR /&gt;'excelApp = Nothing&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jun 2012 17:37:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518296#M135749</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2012-06-27T17:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518320#M135750</link>
      <description>&lt;P&gt;Thanks alot, this is what i am looking for!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2012 17:45:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518320#M135750</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-27T17:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518336#M135751</link>
      <description>&lt;P&gt;Is it possible to open a template excel file somewhere and then save it as a new excel in another place?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2012 17:55:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518336#M135751</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-27T17:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518480#M135752</link>
      <description>&lt;P&gt;Hi MtigaM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To specify the template to use you can use this example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A target="_blank" href="http://inventortrenches.blogspot.com"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'define the file to create/open
myXLS_File = "C:\Temp\Best_Excel_File_Ever.xls"

‘get the Inventor user name from the Inventor Options
myName= ThisApplication.GeneralOptions.UserName

'define Excel Application object
excelApp = CreateObject("Excel.Application")
'set Excel to run visibly, change to false if you want to run it invisibly
excelApp.Visible = True
'suppress prompts (such as the compatibility checker)
excelApp.DisplayAlerts = false

'check for existing file 
If Dir(myXLS_File) &amp;lt;&amp;gt; "" Then
'workbook exists, open it
excelWorkbook = excelApp.Workbooks.Open(myXLS_File)
ExcelSheet = ExcelWorkbook.Worksheets(1)
Else
'create a new spreadsheet from template
&lt;STRONG&gt;excelWorkbook = excelApp.Workbooks.Add (Template: = "C:\Temp\Best_Excel_Template_Ever.xlt")&lt;/STRONG&gt;
End if

'Insert data into Excel.
With excelApp
	.Range("A1").Select
	.ActiveCell.FormulaR1C1 = "Hello, " &amp;amp; myName
End With   

'set all of the columns to autofit
excelApp.Columns.AutoFit   
'save the file
excelWorkbook.SaveAs (myXLS_File)

''close the workbook and the Excel Application
''uncomment if you want to close the xls file at the end
'excelWorkbook.Close
'excelApp.Quit
'excelApp = Nothing       &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2012 18:54:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518480#M135752</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2012-06-27T18:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518506#M135753</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2012 19:11:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/3518506#M135753</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-27T19:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/4317680#M135755</link>
      <description>&lt;P&gt;can we specify the directory of the saved file?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 06:41:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/4317680#M135755</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-03T06:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/8058650#M135756</link>
      <description>&lt;P&gt;Thank you very much. This is&amp;nbsp;brilliant. Could we create different sheets as well&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jun 2018 18:25:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/8058650#M135756</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-10T18:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/8063391#M135757</link>
      <description>&lt;P&gt;I have been using the following code to check if I have the proper amount of worksheets, and add worksheets if necessary:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'Define Excel application and run in the background
xlApp = CreateObject("Excel.Application")
xlApp.Visible = False
xlApp.DisplayAlerts = False
xlWorkbook = xlApp.Workbooks.Add
xlWorksheets = xlWorkbook.Sheets

'Check number of sheets, add if necessary
Do While xlApp.Workbooks(1).Sheets.Count &amp;lt; 3
	xlApp.Workbooks(1).Sheets.Add
Loop

'Name Excel Sheets
xlApp.Workbooks(1).Sheets(1).Name = "First Sheet Name"
xlApp.Workbooks(1).Sheets(2).Name = "Second Sheet Name"
xlApp.Workbooks(1).Sheets(3).Name = "Third Sheet Name"&lt;/PRE&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 17:42:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/8063391#M135757</guid>
      <dc:creator>scottvan</dc:creator>
      <dc:date>2018-06-12T17:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/9757130#M135758</link>
      <description>&lt;P&gt;If the last line of code below is commented, after running the rule it open another read-only excel file. Is it possible to update the excel without closing and opening it again?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;''close the workbook and the Excel Application&lt;/SPAN&gt;
&lt;STRONG&gt;''uncomment if you want to close the xls file at the end
'excelWorkbook.Close
'excelApp.Quit
'excelApp = Nothing&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Sep 2020 17:06:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/9757130#M135758</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-19T17:06:38Z</dc:date>
    </item>
    <item>
      <title>Betreff: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/11478379#M135759</link>
      <description>&lt;P&gt;Hello &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I save the Excel file with the Windows form?&lt;/P&gt;&lt;P&gt;For example, how do I write in sheet 2?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 18:22:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/11478379#M135759</guid>
      <dc:creator>leoow96</dc:creator>
      <dc:date>2022-10-12T18:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a excel file using ilogic? Thanks</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/12652748#M135760</link>
      <description>&lt;P&gt;Hey, for example like this, you can specify the directory and get a variable name for your file. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tableauzeichner1_0-1710920191005.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1339304i02E73DA403360F30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tableauzeichner1_0-1710920191005.png" alt="tableauzeichner1_0-1710920191005.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 07:36:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-create-a-excel-file-using-ilogic-thanks/m-p/12652748#M135760</guid>
      <dc:creator>tableauzeichner1</dc:creator>
      <dc:date>2024-03-20T07:36:56Z</dc:date>
    </item>
  </channel>
</rss>

