CloseExcelFile
Closes the specified Excel file if the file is open. Saves the file before closing.
Syntax
CloseExcelFile(filePath)
Parameters
Parameter |
Type |
Description |
---|---|---|
filePath |
string |
Full path of the Excel file |
Return
None.
Note
See Specifying Windows file paths in Python for details on specifying file paths with backslashes in Python.
Examples
Python
import nex
doc = nex.GetActiveDocument()
nex.ApplyTemplate(doc, "Autocorrelograms")
excelFilePath = r"C:\Data\NexResults.xlsx"
nex.SendResultsToExcel(doc, excelFilePath, "Nex", 0, "A1", 1, 0)
nex.CloseExcelFile(excelFilePath)
NexScript
doc = GetActiveDocument()
ApplyTemplate(doc, "Autocorrelograms")
excelFilePath = "C:\Data\NexResults.xlsx"
SendResultsToExcel(doc, excelFilePath, "Nex", 0, "A1", 1, 0)
CloseExcelFile(excelFilePath)