richo120792
New Member
- Joined
- Jan 25, 2016
- Messages
- 12
Hello, I have the following code in a module and works fine, the problem is when the user closes the window without choosing any file the macro crashes and displays error 1004, I tried some codes from the forum but nothing worked.
Filename = Application.GetOpenFilename _
(FileFilter:=Filt, FilterIndex:=FilterIndex, Title:=Title)
ActiveSheet.OLEObjects.Add(Filename:=Filename, Link:=False, DisplayAsIcon:=True _
, IconFileName:=Filename, _
IconIndex:=0, IconLabel:=Filename).Select
Thanks for the help.
Filename = Application.GetOpenFilename _
(FileFilter:=Filt, FilterIndex:=FilterIndex, Title:=Title)
ActiveSheet.OLEObjects.Add(Filename:=Filename, Link:=False, DisplayAsIcon:=True _
, IconFileName:=Filename, _
IconIndex:=0, IconLabel:=Filename).Select
Thanks for the help.