Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default How to get a return value from a user defined function

Using Excel 2002
I am using the FileDialog sub provided in the help to open a file.
I want to call that from another sub and return the selected filename.
I change FileDialog from a sub to a function but I can't get it to return
the name of the selected file.
Here is what I want to do:

MySub()
MyPik = FileDialog("")
If MyPik = "" then
exit sub
end if
If MyPik < xxx then
exit sub
else
openfile
endif

I can't get the FileDialog function to return the file name

Glen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default How to get a return value from a user defined function

Have a look at GetOpenFilename Method in help.

--
Damon Longworth

Don't miss out on the 2005 Excel User Conference
Sept 16th and 17th
Stockyards Hotel - Ft. Worth, Texas
www.ExcelUserConference.com


"Glen Mettler" wrote in message
...
Using Excel 2002
I am using the FileDialog sub provided in the help to open a file.
I want to call that from another sub and return the selected filename.
I change FileDialog from a sub to a function but I can't get it to return
the name of the selected file.
Here is what I want to do:

MySub()
MyPik = FileDialog("")
If MyPik = "" then
exit sub
end if
If MyPik < xxx then
exit sub
else
openfile
endif

I can't get the FileDialog function to return the file name

Glen




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
user defined function tom_mcd Excel Worksheet Functions 1 January 6th 09 06:23 PM
vlookup, add parameter, on error return user defined value jims2994 Excel Worksheet Functions 0 July 7th 06 02:56 PM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM
Array of 100X250 as return of a user defined function? Andersson Excel Programming 6 May 29th 04 07:06 AM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


All times are GMT +1. The time now is 09:40 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"