PDA

View Full Version : Call function from .XLSB to .XLAM



MaikkiD
06-06-2013, 07:01 AM
Hi All,

I have created my own Worksheet Function that call the bank holiday dates for the year. I am wanting to call the bank holiday dates from the XLSB file so I don't have to change multiple dates each year.

In the XLAM File, I have


Public MBH As Date

Function MBHD() As Date
Application.Run "PERSONAL.XLSB!BankHolidays123"
MBHD = MBH
End Function



And in the XLSB file, I have



Public MBH As Date

Function BankHolidays123()

MBH = #5/5/2014#

End Function



But this isn't working, When I type =MBHD() into a cell, it returns 0 as the value.
Help please? :)

Thanks!

Kenneth Hobs
06-06-2013, 08:15 AM
Your 2nd Function has no return value. Use the function name, not the variable name to set and return the value.

snb
06-07-2013, 01:06 AM
You do not 'Run' a function.