GetOpenFilename in Windows7 problem?

John64

Registered User.
Local time
Yesterday, 17:36
Joined
Apr 30, 2009
Messages
69
I know, no one wants to hear about windows 7 issues yet, but I had no choice. All of this was working fine in XP.

Anyways, this is a little code that I have that is used to initiate a process for taking data daily from an excel spreadsheet to a table in MSAcess. The problem is that when the 'GetOpenFilename' browse box is launched, it doesn't pop to the front of the desktop. It hides back there and you have to alt+tab to figure out where it is hiding at. Kinda comical, but really messing with my secretary as she has no clue as to what is going on.

Code:
Dim appXL As Excel.Application
Dim wbk As Excel.Workbook
Set appXL = New Excel.Application
 
Dim GrabIt As String
GrabIt = appXL.GetOpenFilename("Anext (*.xlsm), *.xlsm", , "Update - Find the Anext file")
If Len(Dir(GrabIt)) > 0 Then
GoTo Continued
ElseIf GrabIt = "" Or False Then
Exit Sub
Else
MyValue = MsgBox("Wrong Path. The file isn't here.", 0, "")
Exit Sub
End If
Continued:
Set wbk = appXL.Workbooks.Open(GrabIt)
appXL.CutCopyMode = False
 
...

Additionally, and possibly related, I have a simple input box for a date that needs to be put in. The input box loads to the front correctly, but isn't selected, so that when you start typing the date, nothing happens until you physically click it with the mouse. Also, very annoying.

Code:
Dim DateProd As String
DateProd = InputBox("Enter the Date of Production", "Production Date?", Default)
If DateProd = "" Or False Then
Any help or suggestions would be appreciated. I've tried switching the whole process to a 'FileOpenDialog' basis, but didn't have much immediate luck. My programming experience is fairly limited. I know just enough to be dangerous. :)
 
Thank You for the help!

I was able to download your file and get the 'varFileName' to work in my code. I like the 'GetFileFromUser' you created much better than trying to figure out why the 'GetOpenFilename' isn't working. I could never get the default directory to change with 'GetOpenFilename' anyways. This is much better. I think I picked up some more programming concepts stumbling my way through it as well. Public variables are a tricky thing.

Yes, though, all of your code and forms, from what I could tell will pop up correctly in Windows 7 to the front of the desktop.

Thanks again
 

Users who are viewing this thread

Back
Top Bottom