Description: A built in form has been provided to allow your users to select which sheet of a given workbook they wish to perform an action on. This form allows your end users to click on a listbox containing sheet names rather than having them specify it by name or index number.
Parameters:
ShowSheetSelectionDialog(sXLSFile As String, bMultipleSelect As Boolean) As String
|
Parameter |
Meaning |
|
sXLSFile |
The source workbook file |
|
bMultipleSelect |
Users can select multiple sheets if you allow them to by setting this parameter to TRUE. Values are returned as a comma-delimited list (i.e. "Sheet2, LastSheet"). |
Example Code:
Taken from the sample VB program from the frmCopySheetData form
Private Sub cmdSelectSheetOriginal_Click()
Dim sSheets As String
bErrorOccurred = False
'check if the file exists first
If Not
frmTestXLSConverterX.FileExists(frmTestXLSConverterX _
strSourceFile) Then
MsgBox "Please specify a file that exists", vbOKOnly, _
"File Does Not Exist"
bErrorOccurred = True
Unload Me
Exit Sub
End If
'displays the dialog box for user to select sheet(s)
sSheets =
frmTestXLSConverterX.XLSConv1.ShowSheetSelectionDialog _
(frmTestXLSConverterX.strSourceFile, False)
If (sSheets <> "") Then
txtCopySheetOriginal = sSheets
End If
End Sub