I wrote a function in VBA called OpenSPDFiles:
Function OpenSDPFiles(Optional ByVal
dDate As Date, Optional ByVal sPath As String, Optional ByVal sFileTypes As String, Optional ByVal sPortfolios As String) As
i pass it those parameters and it opens the file(s) specified by the parameters. in the end OpenSPDFiles equals a string
that is just the concatenated filenames of the files it opened. if i dont pass an argument, a userform opens up and asks for
when I call it from another VBA code, it works fine - the files open. but if i go into an excel cell
and type =OpenSPDFiles(... the files dont open. but the cell value DOES show the file names of what was supposed to open.
AND, if i dont supply one of the params, the userform DOES show. why doesnt the function open the files? I use
Workbooks.Open (sPath & sFile) to open. when i step through the code called from the excel cell, i see it highlight the
Workbooks.Open but it just doesnt execute. any ideas?