LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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




 
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 03:12 AM.

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"