SBendBuckeye
Programmer
I am working with a process that allows automation. It has a very poor file browser and I would like to pop the Windows file browser I use in some Access applications. I can get the Access to work but with some problems. Can any one help me with these? The code is below for reference if anyone needs it.
A. Is there a better way to invoke the function than using Eval? It seems very slow.
B. I make it visible just before I call it, but it comes up in odd sizes and then the File Browser opens inside that. I know I can check Application.Visible within the automation code, but how do I set it visible within the automation code just before it pops up the browser?
C. Can I size the automation screen to the size of the browser window or at least make it look like something before I make it visible?
D. How do I center the File browser window on the screen?
Thanks in advance for any help or suggestions!
Have a great day!
Public Function GetFileName2()
Dim strFileName As String
Dim strPath As String
Dim appAccess As Access.Application
Set appAccess = New Access.Application
appAccess.OpenCurrentDatabase _
"c:\Temp\GetFileName.mdb"
appAccess.Visible = True
strFileName = appAccess.Eval("PopFileBrowser()"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
appAccess.Visible = False
appAccess.CloseCurrentDatabase
Set appAccess = Nothing
GetFileName2 = strFileName
Exit Function
A. Is there a better way to invoke the function than using Eval? It seems very slow.
B. I make it visible just before I call it, but it comes up in odd sizes and then the File Browser opens inside that. I know I can check Application.Visible within the automation code, but how do I set it visible within the automation code just before it pops up the browser?
C. Can I size the automation screen to the size of the browser window or at least make it look like something before I make it visible?
D. How do I center the File browser window on the screen?
Thanks in advance for any help or suggestions!
Have a great day!
Public Function GetFileName2()
Dim strFileName As String
Dim strPath As String
Dim appAccess As Access.Application
Set appAccess = New Access.Application
appAccess.OpenCurrentDatabase _
"c:\Temp\GetFileName.mdb"
appAccess.Visible = True
strFileName = appAccess.Eval("PopFileBrowser()"
appAccess.Visible = False
appAccess.CloseCurrentDatabase
Set appAccess = Nothing
GetFileName2 = strFileName
Exit Function