Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Add-in function calling problem on start


I have an VB6.0 automation add-in which has a set of functions that rea
data from an xml file and return the values. These functions are calle
from excel 2003 spreadsheet cells.

I have one problem in that when the spreadsheet launches, it does no
call the add-in functions and populate the data in the cells. I need t
click on the cells and do a tab change for the functions to be calle
and cells to be populated.

How can I force the add-in functions to be called on the start of th
spreadsheet so that it would populate the sheet with the new values.

Appreciate your help

--
kumar_867
-----------------------------------------------------------------------
kumar_8675's Profile: http://www.excelforum.com/member.php...fo&userid=1569
View this thread: http://www.excelforum.com/showthread.php?threadid=27255

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Add-in function calling problem on start

Hi Kumar,

I have one problem in that when the spreadsheet launches, it does not
call the add-in functions and populate the data in the cells. I need to
click on the cells and do a tab change for the functions to be called
and cells to be populated.

How can I force the add-in functions to be called on the start of the
spreadsheet so that it would populate the sheet with the new values.


I don't think there's an option for 'Recalc on open' for automation addin
functions, which leaves three alternatives:

1. In your automation addin, implement the IDTExtensibility2 interface
(or add an 'Addin' designer). In the OnConnection event, store a
reference to the Excel Application object you're given, then mark each of
your functions as volatile, by starting them with the statement
Application.Volatile = True. This will mean that Excel calls your
function every time it recalcs (including when first loading), so you'll
probably also want to implement some sort of cache of the results.

2. Use a separate addin (or code in the workbook) to respond to the
Workbook_Open event and force a CalculateFull when it's opened.

3. Remember to press Ctrl+Alt+F9 to update all the calcs when you open
the file.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a function in my SQL-DB from VBA KSor Excel Discussion (Misc queries) 0 March 11th 09 02:08 PM
Calling a function and then returning CLamar Excel Discussion (Misc queries) 4 June 19th 06 06:47 PM
calling a function praptisahni Excel Programming 2 April 26th 04 05:17 PM
Function Calling Subroutine Curare Excel Programming 1 February 24th 04 07:11 PM
problem with selection when calling macro externally from VB6 [email protected] Excel Programming 1 November 4th 03 08:17 PM


All times are GMT +1. The time now is 09:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"