User bc3eb0a599
29-09-2009 20:28:13
Hi All:
I have some existing codes (see below) that now do not work with new JChemForExcel (1.1.2). Specifically, calling jchemExcel.ImportFile(file, sheet.Name) no longer works. Does anyone know if this function still supported. If not, what is the replacement new function?
Thanks,
Tom
===================================================
Dim file As String
Dim wb As Workbook
Dim sheet As Worksheet
Dim addin As Office.COMAddIn
Set addin = Application.COMAddIns("JChemExcel.Functions")
Set jchemExcel = addin.Object
'Open another workbook and make the 1st sheet active
Set wb = Workbooks.Add
Set sheet = wb.Sheets(1)
sheet.Activate
' Hide the metadata row by setting the height to 0
sheet.Rows(2).rowHeight = 0
' Find the ChemCart path.
file = ChemCart.GetPath
If Len(Dir(file)) > 0 Then
' Import the file, delete, then close this book
bRet = jchemExcel.ImportFile(file, sheet.Name)
ChemCart.applyFieldOptions
Kill file
Else
'Display error
MsgBox "SDfile to import (" & file & ") not found."
End If