Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6800887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:01:34+00:00 2026-05-26T19:01:34+00:00

I have a UDF non-volatile function in VBA, which requires a global variable (callback

  • 0

I have a UDF non-volatile function in VBA, which requires a global variable (callback to VSTO) initialized.
This function resides in xla or xlam (same behaviour)

Is there a way to cancel calculation of the formula if the variable not yet available?

In Excel Automatic recalculation mode (I don’t want to change that) Excel recalculates cells with my function every time I open a workbook, replacing value saved in a cell with error: “#ARG!”.

I know how to return empty cell if my variable is not initialized, but is it possible to return original value? I checked with a debugger that it has been saved in the workbook. Trying to return Application.Caller.Value2 causes cyclic reference.

Also, the function isn’t called (expected behaviour) if the VBA code is embedded in the workbook (xlsm), or if the workbook is in xls format. However, converting a workbook to xlsx causes the cells to be recalculated after workbook is opened as described.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:01:35+00:00Added an answer on May 26, 2026 at 7:01 pm

    I eventually went with the xlsm approach.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UDF in sql server. I want to call this function at
I have this VBA function: Public Function testPrec(target As Range) As String testPrec =
I have a UDF which returns table variable like -- -- RETURNS @ElementTable TABLE
I have a User Defined Function (UDF) written in Java to parse lines in
Most systems will have a user-defined function (UDF) available. Some will not. i want
I have very simple query that calls a UDF which splits a field by
I have a script which creates a database, stored procs, views, tables, udf. I
I have the following UDF. CREATE FUNCTION [dbo].[udf_GenerateVarcharTableFromStringList] (@list varchar(MAX), @delimiter char(1) = N',')
I have a function in [MHL1P].[x].dbo.udf_Admin_GetNameByID(t3.StaffID) I want to execute this function from another
Suppose I have a UDF MyFunc() which is too costly to call more than

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.