On 07/15/2012 11:07 PM, Stephen Leibowitz wrote:
I am trying to convert an Excel 2003 VBA macro to LibO. I have fixed
the few syntax problems. The heart of the conversion effort will be in
dealing with the two very different APIs. My preference is to Open the
Excel xla file in Calc and have it run until the first runtime error,
which I would then fix. I would repeat the cycle of “run and fix” for
the other errors. When I encounter an error, I would also search for
and fix similar errors, in order to speed up the conversion effort.
My problem is that the Basic processor often does not provide the
error information that I need. The first error message says, “BASIC
runtime error. '420' Invalid object reference.” The end of the
module’s code is displayed, but there is no code highlighted or arrow
pointing to a particular line. I have no idea which object the Basic
processor is complaining about. Pressing the Stop Macro button has no
effect. When I press the OK or X button on the message, the macro
continues to the next error. That error is, “BASIC runtime error. '12'
xlApplication Event.” But even without me dismissing the message, the
processor continues to the next error after a few seconds
I have placed many breakpoints in the code, but this does not seem to
help me in isolating the errors.
This occurs at runtime, yes?
As odd as this may sound, I have occasionally needed to comment out 
sections of code to find problems. If the error is as elusive as you 
say, you may need to find a break-point before the error and then single 
step to the error.
In the past, I have had trouble when I try to access a property or 
method that does not exist for the returned object. I remember at one 
point where the error was triggered when execution entered the sub or 
function that contained the reference, which was a real problem for me 
because I tried to test for the existence of the property or method 
before calling it. This was a very old version of OOo (probably 1.x), 
but the memory stays.
are you perchance using any type of error control in your code? I mean 
"On Error" statements?
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php
--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Context
   
 
  Privacy Policy |
  
Impressum (Legal Info) |
  
Copyright information: Unless otherwise specified, all text and images
  on this website are licensed under the
  
Creative Commons Attribution-Share Alike 3.0 License.
  This does not include the source code of LibreOffice, which is
  licensed under the Mozilla Public License (
MPLv2).
  "LibreOffice" and "The Document Foundation" are
  registered trademarks of their corresponding registered owners or are
  in actual use as trademarks in one or more countries. Their respective
  logos and icons are also subject to international copyright laws. Use
  thereof is explained in our 
trademark policy.