Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Application.GetOpenFilename

This question actually involves Microsoft Word.....

The following code works in Excel, but it gives a compile
error in Word. Does anyone know why?

'--------------------------------------
Public Function MyFileDlg() As String
' This line fails in Word!
NewFN = Application.GetOpenFilename(FileFilter:="Text Files (*.txt), *.txt",
Title:="Please select a file")
If NewFN = False Then
MyFileDlg = ""
Else
MyFileDlg = NewFN
End If
End Function
'-------------------------
Sub Tester()
Dim str As String
str = MyFileDlg
MsgBox str
End Sub




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Application.GetOpenFilename

Hi Robert,

Am Sun, 10 May 2015 02:19:03 -0700 schrieb Robert Crandal:

NewFN = Application.GetOpenFilename(FileFilter:="Text Files (*.txt), *.txt",


Word does not work with GetOpenFileName.
Please have a look:
http://www.erlandsendata.no/english/...foldernameword

P.S.: Did you see in the other thread the solution with Regular
Expressions?


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
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
Application.GetOpenFilename John[_140_] Excel Programming 2 January 1st 10 09:24 PM
Application.GetOpenFileName Chris Excel Programming 7 August 19th 06 12:37 AM
Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen) Paul Martin Excel Programming 5 August 5th 05 04:44 PM
Application.GetOpenFilename Greg[_19_] Excel Programming 3 February 20th 05 01:55 AM
Application.GetOpenFileName ptrowe Excel Programming 2 September 11th 03 12:54 PM


All times are GMT +1. The time now is 04:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"