Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Common Dialog Boxes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Common Dialog Boxes

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Common Dialog from Toolbox JRXPL New Users to Excel 0 April 23rd 08 04:36 AM
Dialog Boxes stacy05 Excel Discussion (Misc queries) 8 February 5th 08 02:02 AM
dialog boxes Dave F Excel Discussion (Misc queries) 5 August 24th 06 10:03 PM
Using Dialog Boxes Goldstar0011 Excel Worksheet Functions 0 November 29th 05 10:46 PM
Common Dialog Box pat Excel Programming 2 July 10th 03 09:44 PM


All times are GMT +1. The time now is 08:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"