XLSConverterX encapsulates all the details required for quick integration. Furthermore, an extensive sample Visual Basic application is provided to get you up to speed quickly and demonstrates XLSConverterX’s capability and usability. Although you may not be using Visual Basic, the approach for all development environments will be similar.
Simply install the product, and add the component to your development environment. Once in place, the routines can be accessed to programmatically convert and manipulate Excel files. The code required to integrate this component in an application is relatively small considering the functionality it provides.
XLSConverterX Features
- Quick integration of this ActiveX component is easy since sample source code is provided.
- Copy specific sheet data from one worksheet to another within the same or a different workbook
- Concatenate/append specified data from a whole folder of workbooks to a single sheet
- Copy an entire worksheet to the same or a different workbook, and specify location within the target workbook
- Delete a single or whole range of sheets within a workbook
- Add a new sheet and specify where to place the new sheet within the workbook
- Move a sheet to a specific place within a workbook
- Rename an existing sheet
- Many other special processes for CSV and/or text files have been built into XLSConverter
- append/concatenate files; original file content is placed at the end of the target file
- remove empty lines
- surround field with quotes
- pad field with spaces
- change comma to other delimiter
- remove empty lines
- include specified rows, discard all others
- include specified columns, discard all others
- remove control characters
- trim excess commas
A sample Visual Basic program is provided to illustrate proper usage of this ActiveX component. Converting an Excel file is as simple as filling out a few properties and then calling the OpenXLSSaveAs() method. A sample piece of the VB code is shown below:
Private Function PerformConversionXLS(strSourceFile As String, _
strSheets As String, _
strTargetFile As String, _
lngTargetType As Long, _
blnDoFormula As Boolean) As Long
Dim lngConvResult As Long
'call OpenXLSSaveAs() with the arguments passed in
lngConvResult = XLSConv1.OpenXLSSaveAs(strSourceFile, strSheets, strTargetFile,
lngTargetType, blnDoFormula)
'check that file was created using the helper function provided
If (lngConvResult = 0) Then
If (FileExists(strTargetFile) = False) Then
lngConvResult = -100
End If
End If
'if function returns error, assign appropriate message
Select Case (lngConvResult)
Case -2
strErr = "Source file does not exist."
Case -3
strErr = "Unable to create Excel Application. Is it installed?"
Case -4
strErr = "Unable to destroy Excel Application."
Case -10
strErr = "General Excel error."
Case -100
strErr = "File does not exist."
End Select
'assign the appropriate return value to the function
PerformConversionXLS = lngConvResult
End Function