Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jj jj is offline
external usenet poster
 
Posts: 2
Default Returning From VBA Event Code Called From Excel 4.0 Macro

I've developed a worksheet including some VBA code which is to be
added to dozens of workbooks, so that we can get the data in them into
a standardised format.

My worksheet includes some VBA code in the Worksheet_Calculate event,
and this has been causing conflicts when the workbook it's added to
already contains macros written in the Excel 4.0 XLM language.

If the XLM macro changes the workbook it triggers the
Worksheet_Calculate event, but this is then unable to hand control
back to the XLM macro which called it. The error message "No RETURN()
or HALT() function found on macro sheet" is displayed.

I've solved the problem by changing the old XLM macro so that the
first thing it does is to set workbook calculation to manual,
switching it back to automatic once it's made all its changes to the
workbook (A spot of error handling is needed here).

This works fine and everyone seems happy with the result, but is there
any way I can solve this problem by including some defensive VBA code
in the Worksheet_Calculate event itself?
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
Returning an Array from a called function within a macro [email protected] New Users to Excel 1 May 18th 07 03:47 PM
Userform_Initialize event failing to be called R Avery Excel Programming 2 March 3rd 04 04:06 AM
Add event code through a macro Hans Bergman Excel Programming 1 October 31st 03 07:04 PM
Copy Sheets minus Worksheet Change Event code & Macro Buttons Bob[_36_] Excel Programming 0 October 8th 03 01:17 AM
Save Event - Determine if called by code or user David Sedberry Excel Programming 0 October 2nd 03 04:56 PM


All times are GMT +1. The time now is 06:59 PM.

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"