Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Open workbook selected form dialog

Hi All,
Below is my code to get the workbook selected by the user. For some or other
reason this dummy
can't get the code to open the selected file. I would like to substitute the
msgbox with the code to
open the file. Any advice would be appreciated.
Thanks in advance



Sub GetFileExample()
Dim fNameAndPath As Variant
fNameAndPath = Application.GetOpenFilename _
(FileFilter:="Excel Files (*.XLS), *.XLS", _
Title:="Select File To Be Opened")
If fNameAndPath = False Then _
Exit Sub
MsgBox fNameAndPath

End Sub

--
HJN
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open workbook selected form dialog

On Jan 13, 12:13*pm, Hennie Neuhoff
wrote:
Hi All,
Below is my code to get the workbook selected by the user. For some or other
reason this dummy * * *
can't get the code to open the selected file. I would like to substitute the
msgbox with the code to
open the file. Any advice would be appreciated.
Thanks in advance * * *

Sub GetFileExample() * *
Dim fNameAndPath As Variant * *
fNameAndPath = Application.GetOpenFilename _ * *
(FileFilter:="Excel Files (*.XLS), *.XLS", _ *
Title:="Select File To Be Opened")
If fNameAndPath = False Then _
Exit Sub
MsgBox fNameAndPath

End Sub

--
HJN


Replace MsgBox statement with Workbooks.Open (fNameAndPath)
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
Open Dialog Box to return Selected File Path and Not Open it. DMS Excel Programming 4 January 26th 10 12:46 PM
Issue with workbook not being selected when form button is clicked robs3131 Excel Programming 3 February 16th 08 12:01 AM
C# open workbook and suppress Read/Write dialog Scott B[_2_] Excel Programming 1 October 9th 06 08:49 PM
using Windows API Open Dialog/Browse in VBA - center form in scree Philip Excel Programming 1 April 19th 05 02:15 PM


All times are GMT +1. The time now is 11:19 PM.

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"