Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Certain Macros don't work in NeoOffice 3.0.2
Certain Macros don't work in NeoOffice 3.0.2
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Wed Feb 03, 2010 10:15 am    Post subject: Certain Macros don't work in NeoOffice 3.0.2

Over the last couple of days, I have discovered that two macros I created some time back and use almost every week are no longer working in NeoOffice 3.0.2.

Both are macros that I recorded, and both make use of the Find/Replace function and regular expressions. I'm almost positive they worked with NeoOffice 3.0.2EA, as today was the first time one of them didn't work, and that one I do indeed use every week.

I don't get any error messages, they just don't do what they are supposed to do.

Normally I run them from custom buttons on the toolbar, but I tried going to Tools>Macros>Run and accessing them that way with no difficulty.

I re-recorded one of the macros today, making a few alterations to perfect the formatting it does for me, and it runs fine.

I'll work on creating a set of files needed to reproduce this. Can I attach a zip file, or do I need to attach them separately?

Lorinda

NeoOffice 3.0.2 patch 0, Mac OSX 10.4.11
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Feb 03, 2010 10:20 am    Post subject:

You can attach a zip file but please include steps to install them and what is supposed to happen when you run the macro.

There have been absolutely zero changes to the OpenOffice.org Basic code in NeoOffice 3.0.2. The only change that I think might affect macros would be the disabling of Excel A1 and R1C1 cell formats in formulas but that should only potentially affect Calc macros written in Excel VBA.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Feb 03, 2010 10:29 am    Post subject:

I have one more request: please tell me which lines in your macros are failing. Generally, debugging other peoples macros is not something that I can do. But what I can do is debug the operation specific macro commands and see if any of NeoOffice's underlying OpenOffice.org code that is executed by a command is failing.

Patrick
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Wed Feb 03, 2010 11:00 am    Post subject:

Embarassed Embarassed Never mind Embarassed Embarassed

Now they are both working fine again. No doubt it was user error, not a Neo error. Sorry to bother you.

Lorinda
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Feb 03, 2010 11:16 am    Post subject:

Lorinda wrote:
Now they are both working fine again. No doubt it was user error, not a Neo error. Sorry to bother you.


No problem. Most likely I would guess that your problem was due to one of the following two causes:

1. Bad data - If your macro is written to expect data in a certain format and you input bad data (like inputting text in a cell that the macro expects to contain a number), your macro will fail without error.

2. Bug in your macro - Macros are custom code and one of most common problems in any custom code is that the code was not written to handle every possible case that it may encounter.

In either case, the best way to find the cause of the problem is to debug your macro by selecting the Tools :: Macros :: Organize Macros :: NeoOffice Basic menu and in the dialog that appears, select your macro and press the Edit button.

The NeoOffice Basic window will appear. Don't press the Run button. Instead, press the Step Over button to execute one line at a time. This allows you to follow the logic that your macro is executing so that you can find the line that is doing something different than you expect. If you find such a line, you can edit your macro to fix the specific bug in your macro, save your macro, and rerun to test your fix.

Hope that helps,

Patrick
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Wed Feb 03, 2010 12:15 pm    Post subject:

Thanks, Patrick.

Both macros were fairly simple text manipulation macros, created by recording a series of Find & Replace commands. I'm guessing that the problem with one of them may have been that the cursor was in the wrong place when I invoked the macro. (Which in effect would be an example of bad data).

The other possibility is the macro isn't clearing previous settings from the Find & Replace dialog before starting. When I went to make the formatting changes by manually calling up Find and Replace, my first attempt didn't work, and I discovered it was because the "format" of the Find box was set for a relatively obscure font (from a "manual" find and replace I executed the other day). If Neo was using that setting when running either of my macros, they wouldn't have worked, because none of the text I was trying to format was in that font.

I'll keep the Step Over command in mind another time. My challenge is that I know next to nothing about NeoOffice Basic and macro programing. I can record and save a macro, or copy code from elsewhere and paste it in the right spot, but that's about it.

Lorinda
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.