DIAdem Help

Method: OpenSpreadsheet for DataPlugin

  • Updated2024-09-12
  • 1 minute(s) read

Method: OpenSpreadsheet for DataPlugin

Uses a specified DataPlugin to open an Excel file. To create this DataPlugin use the file reader Only filename in the Configure DataPlugin dialog box.

The DataPlugin cannot access Excel files that are password protected.

Set oWorkbook = Object.OpenSpreadsheet(FileName, [SpreadsheetType])
ObjectDataPlugin
Object with this method
FileNameString
Specifies the name of the Excel file to be saved with the filename extension and the path.
[SpreadsheetType]Specifies the Excel file type.
If you do not specify this parameter, DIAdem uses the filename extension to specify the Excel file type.
Enumeration with the following selection terms:
 1
eXls
Excel file created with Excel 2003 or an earlier version.
 2
eXlsx
Excel file created with Excel 2007 or Excel 2010.
 3
eOds
Excel file created with OpenOffice.
 4
eCsv 
Excel file created in the CSV format (Character Separated Values).
oWorkbookWorkbook
Returned object

The following example opens an Excel file and saves the author of the workbook as a root property:

Sub ReadStore(File)
  Dim oExcelFile
  Set oExcelFile = OpenSpreadsheet("C:\ExcelExample.xls")
  Call Root.Properties.Add("Author",oExcelFile.WorkbookInfo.Author)
End Sub

Log in to get a better experience