Certainly seems like a bug, if its causes are as describe.
In that case, why not implement a class wrapper to API version. That should
shield you from an Excel influences. e.g.
Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA"
(pOpenfilename As OPENFILENAME) As Long
NickHK
"Lazzaroni" wrote in message
...
Peter:
Thanks for pointing out that thread to me. I had not seen it.
I am using Excel 2003 SP2. I also have conditional formatting using
formulas
in the sheets calling the procedure. In my case the conditional formatting
does not appear to be causing any problems. Rather, the problem appears to
have been that the workbook in which the code is stored (PERSONAL.XLS) had
more than one module in. Once I moved all procedures to one module and
deleted all the others GetOpenFilename with Multiselect = True appears to
be
consistently returning an array.
I only made the change today, so if I run into the error again I'll post
another reply.
I found the suggestion to use only one module at this address:
http://www.dailydoseofexcel.com/arch...topenfilename/
September 12th, 2004 at 7:17 pm JohnT Says:
"I have a GetOpenFilename with MultiSelect:=True which works perfectly if
it
is the only module in my Excel work book. But If I copy the exact same
code
(CRTL/A - CTRL/C) to an empty module (CTRL/V) in a file which has a heap
of
other code then it refuses to do the multislect but will only return a
single
file. Any bright ideas as to what may be going on in the depths of VBA?"