JChem for Excel API

Back to index page

Introduction

In the 1.1.3 build of JChem for Excel (JC4XL) its application programming interface (API) has been introduced. API provides the most popular functionalities of the application to make them available either from other Excel plug-ins (VBA and COM) or from standalone desktop applications.

In the next versions of the product the public API will be changed and extended progressively keeping the compatibility with previous API releases.

 

Architecture

 

API.Architecture

 

Our API infrastructure basically consists of 2 main compartments from the aspect of reuse. Internally, inside of Excel the add-in itself is accessible from any macro modules and other sibling add-in modules. Externally, from desktop applications and also from a VBA macro module an external helper library is also available to invoke the main functionalities of JC4XL.

Based on the accessibility these two compartments (Internal and External API) can be mentioned, which will be outlined in the next couple of sections.

 

API interface

The common API interface is organized in a separate library (JChemExcelCOMInterfaces library) Figure 1. This library will represent the main functionalities of JC4XL for both internal and external API tools (Available versions are 1.0 -1.3).

 

Detailed function description:

Function Name

Parameters

Optional

Type in COM

Type in VBA

Type in C#/Java

AddStructuresToColumn
(1.0)

structures (molecules in string format)

N

SAFEARRAY(BSTR)

Dim () as string

string[]

 

format (smiles, mol, ..)

N

BSTR

string

string

 

column
(target molecule where the molecules go in)

N

long

long

long

 

header (header text)

Y

VARIANT(BSTR)

string

string

 

workbookName

Y

VARIANT(BSTR)

string

string

 

worksheetName

Y

VARIANT(BSTR)

string

string

 

startRow
(row index where the structures will be placed from)

Y

VARIANT(long)

long

long

 

 

 

 

 

 

GetStructuresFromColumn
(1.0)

format
(common format, which the result to be converted to)

N

BSTR

string

string

 

column
(column index which get mols extracted from)

N

long

long

long

 

workbookName

Y

VARIANT(BSTR)

string

string

 

worksheetName

Y

VARIANT(BSTR)

string

string

 

startRow
(range start index)

Y

VARIANT(long)

long

long

 

endRow
(range end index)

Y

VARIANT(long)

long

long

 

 

 

 

 

 

 

return value

 

SAFEARRAY(VARIANT)*

Dim () As Variant

object[]

GetStructuresByFormula
(1.0)

 

 

 

 

 

 

formula
(array of hashes we are intetersted in)

N

SAFEARRAY(BSTR)

Dim () as string

string[]

 

format
(common format, which the result to be converted to)

N

BSTR

string

string

 

 

 

 

 

 

 

return value

 

SAFEARRAY(VARIANT)*

Dim () As Variant

object[]

ImportFromFile
(1.0)

fileName
(file name containing the materials)

N

BSTR

string

string

 

workbookName

Y

VARIANT(BSTR)

string

string

 

worksheetName

Y

VARIANT(BSTR)

string

string

 

append
(the file content should be appeneded or not)

Y

VARIANT(BOOLEAN)

boolean

boolean

 

 

 

 

 

 

EnableDrawing

(property get/set)
(1.1)

Enable or disable structure drawing for the whole application instance

Y

VARIANT(BOOLEAN)

boolean

boolean

JChemExcelVersion (property get)
(1.1)

return value

Y

BSTR

string

String

GetAvailableActions

(1.2)

return value

 

SAFEARRAY(VARIANT)*

Dim () As Variant

object[]

ExecuteAction

(1.2)

actionId

(string id of the action to be executed)

Y

BSTR

string

string

ExportToFile

(1.3)

fileName

(file name containing the materials after export)

N

BSTR

string

 

 

Format (chemical or data file format)

N

BSTR

string

 

 

workbookName

N

BSTR

string

 

 

worksheetName

N

BSTR

string

 

 

exportHeaderRow

N

VARIANT (BOOLEAN)

boolean

boolean

 

startRow (range)

N

long

long

long

 

endRow (range)

N

long

long

long

 

startColumn (range)

N

long

long

long

 

endColumn (range)

N

long

long

long

 

fileOptions

(All data including chemical and non-chemical data,

Strucures Only, Structures Only but each structure go

Separate files)

N

ExportToFileOptions

enum

 

 

IsLoaded (property get) (1.4)

return value

Y

VARIANT(BOOLEAN)

boolean

boolean

AddStructuresIdsToColumn
(1.5)

structures (molecules in string format)

N

SAFEARRAY(BSTR)

Dim () as string

string[]

 

ids (molecules in string format)

N

SAFEARRAY(BSTR)

Dim () as string

string[]

 

format (smiles, mol, ..)

N

BSTR

string

string

 

column
(target molecule where the molecules go in)

N

long

long

long

 

header (header text)

Y

VARIANT(BSTR)

string

string

 

workbookName

Y

VARIANT(BSTR)

string

string

 

worksheetName

Y

VARIANT(BSTR)

string

string

 

startRow
(row index where the structures will be placed from)

Y

VARIANT(long)

long

long