Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Directory browser in Excel VB

I have an Excel workbook that consist of 3 sheets of forms to fill out.
These forms must be updated quarterly. I am going to use a database query to
pull the info needed into the workbook. The problem is for the user to
select the correct system and quarter for the query to update the forms.
The question is can I use VB to open the file directory browser and use his
selection to drive which database file to query? If so, what code is used to
accomplish this?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Directory browser in Excel VB


-----Original Message-----
I have an Excel workbook that consist of 3 sheets of

forms to fill out.
These forms must be updated quarterly. I am going to use

a database query to
pull the info needed into the workbook. The problem is

for the user to
select the correct system and quarter for the query to

update the forms.
The question is can I use VB to open the file directory

browser and use his
selection to drive which database file to query? If so,

what code is used to
accomplish this?


.


Yes - the Excel File Open dialog box can be activated
through VB:

FileToOpen = Application.GetOpenFileName ([File Filter],
[FilterIndex],[Title],[ButtonText],[MultiSelect])

FileToOpen will have the path to the selected file. The
parameters let you choose file extensions to show, etc.

(search the MSDN library for more info)
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Directory browser in Excel VB

John Walkenbach:
Tip #29
http://www.j-walk.com/ss/excel/tips/tip29.htm

--
Regards,
Tom Ogilvy

"Mike Fogleman" wrote in message
...
I have an Excel workbook that consist of 3 sheets of forms to fill out.
These forms must be updated quarterly. I am going to use a database query

to
pull the info needed into the workbook. The problem is for the user to
select the correct system and quarter for the query to update the forms.
The question is can I use VB to open the file directory browser and use

his
selection to drive which database file to query? If so, what code is used

to
accomplish this?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Directory browser in Excel VB

Database *file* suggests MS Access. If so, try this function:

Private Function GetJetDBName() As String
' Returns path & filename of user-selected Jet file
Dim vntFullFileName As Variant
Const WILDCARD_MSACCESS As String = "MS Access Databases (*.mdb), *.mdb"
Const TITLE As String = "Choose a Jet database file"
vntFullFileName = Excel.Application.GetOpenFilename(WILDCARD_MSACCES S, 1, TITLE)
If vntFullFileName = False Then
Exit Function
End If
GetJetDBName = CStr(vntFullFileName)
End Function

--

"Mike Fogleman" wrote in message ...
I have an Excel workbook that consist of 3 sheets of forms to fill out.
These forms must be updated quarterly. I am going to use a database query to
pull the info needed into the workbook. The problem is for the user to
select the correct system and quarter for the query to update the forms.
The question is can I use VB to open the file directory browser and use his
selection to drive which database file to query? If so, what code is used to
accomplish this?

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 Excel not in a browser JS82 Excel Discussion (Misc queries) 1 March 30th 07 02:42 PM
excel can not open on some IE browser Faiz Excel Discussion (Misc queries) 3 July 20th 06 01:29 PM
Excel in a Browser and Security Glenn Rathke \(Soft Design Consulting\) Excel Worksheet Functions 0 July 7th 06 01:23 PM
add browser menu in excel scottish_warrior Excel Discussion (Misc queries) 2 March 17th 05 03:39 AM
Check if directory empty OR no of files in directory. Michael Beckinsale Excel Programming 2 December 4th 03 10:12 PM


All times are GMT +1. The time now is 02:26 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"