Search code examples
excelbloombergvba

'C:\blp\API\Office Tools\BloombergUI.xla'! keeps adding itself onto my Excel Formula


I have Bloomberg Excel Add-In installed on my computer and I have a VBA Function that check if the file exists in a folder:

Function FileExists(sPath As String)
    FileExists = Dir(sPath) <> ""
End Function

I use that as part of my Excel cell formula. E.g.:

=FileExists([File_Name.xlsx])

And this returns me either True or False

This works fine by itself. However, from time to time when I open the file, I would find the formula becoming ='C:\blp\API\Office Tools\BloombergUI.xla'!FileExists([File_Name.xlsx]) for no apparent reason whatsoever and this results in error.

Anyone else experienced this problem before? Are there any solutions to this?


Solution

  • Took a look in the BloombergUI.xla file. Could be wrong here but I found FileExist to be an internal check for the plugin. So Excel confuses my custom function with the plugin's function.

    Long story short, to solve this problem just simply change custom function name. It's been about a month so far with no more ='C:\blp\API\Office Tools\BloombergUI.xla'! issues.