Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default GetOpenFilename, MS Access 2k

Hi folks,

as we all know, above mentioned fine Open dialogue
object is not available in Access, only in Excel. The pity is,
that there is no other equivalent object in Access that offers
the same comfort (aside of huge self-written VBA-procs.
for to make use of the API).

I wonder if there is any workaround. Is it possible by VBA-code
to call up from Access an Excel workbook that is "prepared"
with VBA code for to start that GetOpenFilename dialogue
to navigate through the directories, make a dataset
available for Access, and then close Excel and jumping
right back to the calling VBA-routine in Access, now having
access to the opened file?

If not, would it be possible to do likewise with an Word-mail-merge
template? Thanks in advance for any hint.

Best Regards from Germany
Peter
www.pkf-ostermann.de

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default GetOpenFilename, MS Access 2k

Peter,
I tend to use the API even in Excel.
Whilst some lines are needed for the constants, OPENFILENAME type and
declarations, once it's wrapped it in a class you have it for all
situations.
It seems a waste to start up Excel just to use its .GetOpenFileName dialog.

Not sure what you need from Word, but automation should allow to do most
thing. e.g.
Dim MyWord As Word.Application
Set MyWord= New Word.Application
With MyWord.ActiveDocument.MailMerge
.MainDocumentType
....etc

NickHK

"Peter Ostermann" wrote in message
...
Hi folks,

as we all know, above mentioned fine Open dialogue
object is not available in Access, only in Excel. The pity is,
that there is no other equivalent object in Access that offers
the same comfort (aside of huge self-written VBA-procs.
for to make use of the API).

I wonder if there is any workaround. Is it possible by VBA-code
to call up from Access an Excel workbook that is "prepared"
with VBA code for to start that GetOpenFilename dialogue
to navigate through the directories, make a dataset
available for Access, and then close Excel and jumping
right back to the calling VBA-routine in Access, now having
access to the opened file?

If not, would it be possible to do likewise with an Word-mail-merge
template? Thanks in advance for any hint.

Best Regards from Germany
Peter
www.pkf-ostermann.de



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default GetOpenFilename, MS Access 2k

Peter,

I tested this from Word not Access but same principle

Sub getFile()
Dim xlApp As Object
Dim sFile

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
sFile = xlApp.GetOpenFilename("Text Files (*.txt), *.txt")
If sFile < False Then
MsgBox "Open " & sFile
End If
xlApp.Quit
Set xlApp = Nothing

End Sub



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Peter Ostermann" wrote in message
...
Hi folks,

as we all know, above mentioned fine Open dialogue
object is not available in Access, only in Excel. The pity is,
that there is no other equivalent object in Access that offers
the same comfort (aside of huge self-written VBA-procs.
for to make use of the API).

I wonder if there is any workaround. Is it possible by VBA-code
to call up from Access an Excel workbook that is "prepared"
with VBA code for to start that GetOpenFilename dialogue
to navigate through the directories, make a dataset
available for Access, and then close Excel and jumping
right back to the calling VBA-routine in Access, now having
access to the opened file?

If not, would it be possible to do likewise with an Word-mail-merge
template? Thanks in advance for any hint.

Best Regards from Germany
Peter
www.pkf-ostermann.de



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
GetOpenFilename Craig[_2_] Excel Programming 4 December 15th 05 04:36 PM
GetOpenFileName help Leith Ross[_12_] Excel Programming 0 April 8th 05 10:14 PM
GetOpenFilename Chodu Excel Programming 1 May 17th 04 06:17 PM
getopenfilename in access solo_razor[_42_] Excel Programming 1 December 10th 03 09:27 AM
getopenfilename inquirer Excel Programming 1 December 3rd 03 11:37 AM


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