View Single Post
 
Old 05-17-2020, 11:31 AM
coffent coffent is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Dec 2019
Posts: 40
coffent is on a distinguished road
Default How to call a function in VBAProject(PERSONAL.XLSB)

I have a simple test function fTest2 in VBAProject(PERSONAL.XLSB). I can run it from a spreadsheet by inserting "=PERSONAL.XLSB!fTest2(4)" into a cell. However if I try to do the same thing in VBA using
Dim X
X = Application.Run("PERSONAL.XLSB!fTest2(4)")
I find X = "Error 2015".


What am I doing wrong?


Solved the problem: It should be: X = Application.Run("PERSONAL.XLSB!fTest2", 4)

Last edited by coffent; 05-17-2020 at 07:08 PM. Reason: Solved the problem
Reply With Quote