ExcelArrayToFile

From GECK
Jump to: navigation, search


A function added by the SUP NVSE Plugin.

Description

Writes number(float\int) to specified Excel file.

Syntax

[help]
(iSuccess:int) ExcelArrayToFile filepath:string WorksheetID:int StartRow:int StartColumn:int myArr:array Horizontal(0/1):int 

Or:

(iSuccess:int) XLSArrayToFile filepath:string WorksheetID:int StartRow:int StartColumn:int myArr:array Horizontal(0/1):int

Example

array_var ar_toFile
let ar_toFile :=ar_construct "array"
Ar_append ar_toFile 2
Ar_append ar_toFile "MyString"
Ar_append ar_toFile 3.5
Ar_append ar_toFile PlayerRef 
set iSuccess to ExcelArrayToFile "aaExcelFile" 0 0 0 ar_toFile

Will output following values to "aaExcelFile.XLS" vertically:

A
B C D
1 2
2 MyString
3 3.5
4 Courier
set iSuccess to ExcelArrayToFile "aaExcelFile" 0 0 0 ar_toFile 1

Will output following values to "aaExcelFile.XLS" horizontally:

A
B C D
1 2 MyString 3.5 Courier
2
3
4

Notes

  • If file doesn't exist, it will be created.
  • If sheet in file doesn't exist, it will be created.
  • File name is specified without extension.
  • Cell row and column indexes start with 0.
  • Sheet index starts with 0.
  • If file can't be loaded(i.e. - it's open in Excel at the moment) - function returns -1.

See Also