Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a common dialog box "File Open" that appears when
I initialize a user form. I select the file I need, but when I press OK, the file does not open, although my selected filename appears in the common dialog box as a filename property. What steps must I take to open the file on the screen? Lionel |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
the comm dialog box has a .filename property which will
hold the name of the selected file or will be empty ( null string) if cancelled. add a CDB and a button to a userform and add this code Private Sub CommandButton1_Click() Dim FN As String If FN < "" Then Workbooks.Open FN End If End Sub Private Function GetFileName() As String With CommonDialog1 .CancelError = False .ShowOpen GetFileName = .Filename End With End Function HTH Patrick Molloy Microsoft Excel MVP -----Original Message----- I have a common dialog box "File Open" that appears when I initialize a user form. I select the file I need, but when I press OK, the file does not open, although my selected filename appears in the common dialog box as a filename property. What steps must I take to open the file on the screen? Lionel . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Common Dialog from Toolbox | New Users to Excel | |||
Dialog Boxes | Excel Discussion (Misc queries) | |||
dialog boxes | Excel Discussion (Misc queries) | |||
Using Dialog Boxes | Excel Worksheet Functions | |||
Common Dialog Box | Excel Programming |