|
|
|
|
|
- Opening an XLS file
- Example for modifying an Excel file via an xlsDocument variable
- Example for creating an Excel file via an xlsDocument variable
Example for modifying an Excel file via an xlsDocument variable // Open the document MyWorksheet is xlsDocument FileName is string FileName = fSelect(fExeDir(), "", ... "Select a file...", ... "All files (*.*)" + TAB + "*.*", "*", fselOpen + fselExist) IF FileName = "" THEN RETURN MyWorksheet = xlsOpen(FileName, xlsWrite) Â // Write into the cell (A;25) MyWorksheet[25,"A"] = "OK" Â // Save the document xlsSave(MyWorksheet) Â // Close document xlsClose(MyWorksheet)
Example for creating an Excel file via an xlsDocument variable // Declare an Excel Document variable docExcel is xlsDocument  // Create the worksheet xlsAddWorksheet(docExcel, "Worksheet 1", 1) docExcel..Worksheet = 1  // Modify the worksheet docExcel..Row[1]..Cell[1] = "...."  // Etc...  // Save the file sFileName is string = fExeDir() + ["\"] + "ExcelFile.xls" xlsSave(docExcel, sFileName)  // Close the file xlsClose(docExcel)  // Display in Excel Multitask(50) ShellExecute(sFileName)
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|