Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default GetOpenFilename returns a string rather than an array


I was having the exact same problem and was able to track it down t
Conditional Formatting with a function in the "Formula Is" field.
Don't ask me why, but if you try to do a Multi-select and one of th
cells in any open workbook has Conditional Formatting using th
"Formula Is" option and then a function in the formula cell, it fail
to return the array of filenames. Clearly this is a bug and it may als
be caused by something else equally as obscure.

Try it and let me know what you come up with.

The next trick is to try to find all of the conditional formatting i
my worksheet!

Dan Frederick
Claritech Solutions


Geoff Kelly wrote:[color=blue]
*This is weird. I copied your code into a macro and saw simila
behaviour -
with the singlefileselect lines commented out, I got the user cancel
message. Re-inserting them let multiselect work fine.
Now for the really weird part - it then continued to work fine after
commenting them out again, even after rebooting my PC, eve
re-creating the
macro in another workbook!
Following code works every time now (ie f is an array if one or mor
files
selected)

Sub test1()
Dim f As Variant
f = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(f) Then
MsgBox "count=" & Format(UBound(f)) & ", f(1)=" & f(1)
Else
MsgBox "not array, " & f
End If
End Sub

Geoff

"Lew" wrote in message
om...
-- More on this issue ---

GetOpenFilename() appears to work on the PC if and only if you cal

it
with Multiselect set to "false" first.

If I comment out the lines in the sniplet bleow to do the
singlefileselect first, the multiselect quits working.

This used to work right. Does anyone know what the problem is??

Lew
--- sniplet --

Sub TestIt()
Dim SingleFileSelect As String
Dim MultiFileSelect As Variant
Dim i As Integer

SingleFileSelect

Application.GetOpenFilename(MultiSelect:=False)
MsgBox "No multi select " & SingleFileSelect

MultiFileSelect = Application.GetOpenFilename(MultiSelect:=True)

If IsArray(MultiFileSelect) Then
For i = LBound(MultiFileSelect) To UBound(MultiFileSelect)
MsgBox "Multi select " & MultiFileSelect(i)
Next i
Else
MsgBox "User pressed cancel"
End If
End Sub




-
Claritec
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message472480.htm

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
How do I return a text string when a calculation returns a non who bcronin Excel Worksheet Functions 9 August 6th 09 06:41 PM
Help formula that returns a text string from another sheet Stuart k Excel Worksheet Functions 1 April 7th 08 01:53 PM
A function that returns the formula of a cell as a string Lacty Excel Worksheet Functions 9 March 6th 08 05:13 PM
GetOpenFilename returns a string rather than an array Dan Frederick Excel Programming 0 April 20th 04 08:38 PM
Calling a C++ DLL which returns a String Vorreiter Johann \(IFDA\) Excel Programming 2 January 13th 04 06:59 AM


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