{ From user Lonnie, Model Try_excel_functions at Thu, Jan 01, 2009 11:01 AM~~ } Softwareversion 4.2.0 { System Variables with non-default values: } Usetable := 0 Typechecking := 1 Checking := 1 Saveoptions := 2 Savevalues := 0 {!40000|Att_contlinestyle Graph_primary_valdim: 1} Model Try_excel_functions Title: Try Excel Functions Author: Lonnie Date: Sat, Dec 15, 2007 10:14 AM Saveauthor: Lonnie Savedate: Thu, Jan 01, 2009 11:01 AM Defaultsize: 48,24 Diagstate: 1,1,0,609,485,17 Fontstyle: Arial, 15 Fileinfo: 0,Model Try_excel_functions,2,2,0,0,W:\TestModels\Try Excel ~~ Functions.ANA Variable Workbook Title: workbook Definition: OpenExcelFile("W:\Testmodels\Book1.xls") Nodelocation: 112,64,1 Nodesize: 48,24 Valuestate: 2,245,110,416,303,0,MIDM Variable Cell_contents Title: Cell Contents Definition: WorksheetCell(Workbook,"Sheet1","B",2) Nodelocation: 248,64,1 Nodesize: 48,24 Variable Single_number_range Title: Single number range Definition: WorksheetRange(Workbook,"Sheet1","Discount_rate") Nodelocation: 248,128,1 Nodesize: 48,31 Valuestate: 2,530,185,416,303,0,MIDM Reformval: [Sys_localindex('COLUMN'),Sys_localindex('ROW')] Variable Column_index Title: column index Definition: worksheetRange(workbook,"Sheet1","Year" ) Nodelocation: 248,192,1 Nodesize: 48,24 Valuestate: 2,445,232,416,303,0,MIDM Reformval: [Sys_localindex('COLUMN'),Sys_localindex('ROW')] Variable By_abs_ref Title: By Abs ref Definition: worksheetRange(Workbook,"Sheet1","B7:F11" ) Nodelocation: 248,248,1 Nodesize: 48,24 Valuestate: 2,205,291,689,314,0,MIDM Reformval: [Sys_localindex('COLUMN'),Sys_localindex('ROW')] Variable Income_stmt Title: Income stmt Definition: worksheetrange(Workbook,"Sheet1","IncomeStmt",rowIndex:Cat~~ egory,colIndex:Year) Nodelocation: 376,248,1 Nodesize: 48,24 Valuestate: 2,499,46,416,303,0,MIDM Reformval: [Year,Category] Index Year Title: Year Definition: copyindex(worksheetRange(workbook,"Sheet1","Year" )) Nodelocation: 376,192,1 Nodesize: 48,24 Variable Col_of_year Title: col of year Definition: Slice(Column_index.Column,@Year) Nodelocation: 376,128,1 Nodesize: 48,24 Constant Force_col Title: Force Col Definition: 1 Nodelocation: 392,40,1 Nodesize: 48,24 Constant Force_row Title: Force Row Definition: 2 Nodelocation: 488,40,1 Nodesize: 48,24 Variable Revenue Title: revenue Definition: worksheetrange(workbook,"Sheet1","B10:F10",colIndex:Year,h~~ owToIndex:0) Nodelocation: 376,320,1 Nodesize: 48,24 Valuestate: 2,378,282,416,303,0,MIDM Reformval: [Year,Sys_localindex('ROW')] Index Category Title: Category Definition: ['Revenue','Expenses'] Nodelocation: 240,320,1 Nodesize: 48,24 Variable Write_to_cell Title: Write to cell Definition: Index c := 2..5;~ index r := 15..19;~ WriteWorksheetCell( Workbook, "Sheet1", "B", 14, "=Sum(B15:E19)") Nodelocation: 112,176,1 Nodesize: 48,24 Reformval: [Sys_localindex('R'),Sys_localindex('C')] Variable Write_to_range Title: Write to range Definition: index c:=2..4;~ index r:=21..22;~ WriteWorksheetRange( Workbook, "Sheet1", "B21:D22", r*10+c, c, r )~~ Nodelocation: 112,240,1 Nodesize: 48,24 Valuestate: 2,433,157,416,303,0,MIDM Reformval: [Sys_localindex('C'),Sys_localindex('R')] Variable Write_to_range_1d Title: Write to range 1D Definition: index x:=1..2;~ WriteWorksheetRange( Workbook, "Sheet1", "B24:E25", x, x ) Nodelocation: 112,296,1 Nodesize: 48,24 Variable Write_scalar_to_rang Title: Write scalar to range Definition: index c:=2..4;~ index r:=21..22;~ WriteWorksheetRange( Workbook, "Sheet1", "B27:D28", 99 ) Nodelocation: 104,344,1 Nodesize: 48,24 Valuestate: 2,104,114,416,303,0,MIDM Variable Write_to_named_nonre Title: Write to named nonrect range Definition: index x:=5..7;~ index y:=5..7;~ WriteWorksheetRange(Workbook,"Sheet1","diagRange",10*y+x,x,y) Nodelocation: 104,394,1 Nodesize: 48,40 Valuestate: 2,492,83,416,303,0,MIDM Reformval: [Sys_localindex('Y'),Sys_localindex('X')] Variable Write_named_range Title: write named range Definition: index c:=1..9;~ index r := 1..9;~ writeworksheetrange(Workbook,"Sheet1","ThreeBy2",10*r+c,c,r) Nodelocation: 104,457,1 Nodesize: 48,31 Reformval: [Sys_localindex('R'),Sys_localindex('C')] Variable Big_write Title: Big write Definition: index c:=1..108;~ index r := 1..10K;~ writeworksheetRange(Workbook,"Sheet2","A1:DD10000", r*1000+c,c,r ) Nodelocation: 248,392,1 Nodesize: 48,24 Reformval: [Sys_localindex('R'),Sys_localindex('C')] Variable Save1 Title: Save Definition: SaveExcelWorkbook(Workbook) Nodelocation: 248,472,1 Nodesize: 48,24 Variable Saveas Title: SaveAs Definition: SaveExcelWorkbook(Workbook,"C:\Temp\Book2.xls") Nodelocation: 352,448,1 Nodesize: 48,24 Close Try_excel_functions