PDA

View Full Version : using application.getopenfilename keeps opening new app



mg25683
07-15-2022, 06:24 AM
Hi, I have a strange issue that happens only on my machine.
Simply running the line with application.getopenfilename opens a new application (I mean new a p p l i c a t i o n/ excel process)
The arguments/other factors do not matter, I get the same effect even if i run the line in the immediate window.

Any idea?

Aussiebear
07-15-2022, 06:45 AM
Without seeing your code, we are simply guessing, however are you using this in the following format



Filename = Application.GetopenFileName

mg25683
07-15-2022, 06:54 AM
Without seeing your code, we are simply guessing, however are you using this in the following format


[/CODE]

What are you guessing bro?

1. Put "application.GetOpenFilename" in immediate window
2. Hit enter
3. Select any file

Bang! New application opens

mg25683
07-15-2022, 07:31 AM
office reinstall didnt help:(

snb
07-15-2022, 07:41 AM
Hi sis, why don't you use Excel ?


Sub M_snb()
With Application.FileDialog(3)
If .Show Then Workbooks.Open .SelectedItems(1)
End With
End Sub

Tom Jones
07-15-2022, 01:01 PM
Hi sis, why don't you use Excel ?


Sub M_snb()
With Application.FileDialog(3)
If .Show Then Workbooks.Open .SelectedItems(1)
End With
End Sub

:clap::clap::clap::clap::clap::clap::clap::clap::clap:

mg25683
07-15-2022, 11:58 PM
For some reason, application.filedialog has exactly the same effect - new excel process opens up

(once again: it opens up when the dialog is used, even without workbooks.open )

georgiboy
07-18-2022, 06:14 AM
So if you run the below in a new excel file, does it open the file or return the name and location:

Sub GetFileName()
Dim Finfo As String
Dim Title As String
Dim FileName As Variant

Finfo = "All Files (*.*),*.*"
Title = "Select a File"

FileName = Application.GetOpenFilename(Finfo, , Title)

If FileName = False Then
MsgBox "No file was selected."
Else
MsgBox "You selected " & FileName
End If
End Sub

Paul_Hossler
07-26-2022, 02:46 PM
What are you guessing bro?

1. Put "application.GetOpenFilename" in immediate window
2. Hit enter
3. Select any file

Bang! New application opens

Then don't use the Immediate Window

Use .GetOpenFilename in a macro

Jan Karel Pieterse
07-28-2022, 05:13 AM
Does not happen for me. I suggest to do an on-line repair of your Office installation.