Skip to content

Instantly share code, notes, and snippets.

Created April 9, 2018 09:17
What would you like to do?
GH C# Component tips_ExcelのデータをGrasshopperに読み込む(任意のExcelファイルがあらかじめ開かれていることを前提とした記述)
private void RunScript(bool getParam, string filePath, ref object A, ref object B, ref object C)
Microsoft.Office.Interop.Excel.Application exlApp =
Microsoft.Office.Interop.Excel.Workbook wb = exlApp.ActiveWorkbook;
Microsoft.Office.Interop.Excel.Worksheet ws1 = (Worksheet) wb.Sheets[1];
Range range23 = (Range) ws1.Cells[2, 3];
A = range23.Value;
Range range33 = (Range) ws1.Cells[3, 3];
B = range33.Value;
C = ws1.get_Range("A1", "C3").Value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment