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

Download or installation problems? Try these steps
Problems after upgrading to NeoOffice 2022? Try these steps


Support
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


RSS Feeds
· Announcements Only
· All Posts


  
NeoOffice :: View topic - macro bug? (Bugzilla down)
macro bug? (Bugzilla down)
 
Post new topic   Reply to topic    NeoOffice Forum Index -> NeoOffice Testing
View previous topic :: View next topic  
Author Message
Rooster
Agent


Joined: Feb 11, 2004
Posts: 16

PostPosted: Fri Dec 03, 2004 4:02 pm    Post subject: macro bug? (Bugzilla down) Reply with quote

Hi, I ran across what may be a bug in NeoJ 1.1 Alpha 2 Patch 5 and I thought you might like to know about it. Here it is:

I use a macro for parsing text into columns, it was posted on the OOo web-site some ago as a TextToColumns-like behavior fix. The only problem is that it parses numbers as text (e.g., not "5" but "'5", with a preceding apostrophe) so I wrote a macro to convert text to numbers (see below for the macro). When I try to run this macro, it gives an error message, "BASIC runtime error. Variable not defined." on the fourth line down, "oSelectColumn=ThisComponent.CurrentSelection.Columns". This macro runs okay on NeoJ 0.8.4 and with OOo 1.1 for X11. It seems like its specific to this particular line because there are a few lines before it that run okay and the TextToColumns macro runs as well.

So is this a bug, or is it something that is beyond your control? Thanks!

Cheers,
Andrew


Sub TextToNumber
Dim oSheet As Object, oCell As Object, cellstring As String
oSheet=StarDesktop.CurrentComponent.CurrentController.ActiveSheet
oSelectColumn=ThisComponent.CurrentSelection.Columns
oSelectRow=ThisComponent.CurrentSelection.Rows

CountColumn=oSelectColumn.getCount
CountRow=oSelectRow.getCount

oSelectEC=oSelect.EndColumn
oSelectSC=oSelect.StartColumn

oSelectSR=oSelect.StartRow
oSelectER=oSelect.EndRow

For nc= 0 To ((oSelect.EndColumn-oSelect.StartColumn))
For nr = 0 To(oSelect.EndRow-oSelect.StartRow)

oCell=oSheet.getCellByPosition(nc+oSelect.StartColumn,nr+oSelect.StartRow)
oCell.setValue(oCell.getString)
Next nr
Next nc
End Sub
Back to top
View user's profile Send private message
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11932

PostPosted: Fri Dec 03, 2004 4:04 pm    Post subject: Reply with quote

Can you try downloading the lastest patch - "Patch-8" - and see if you still have the same problem?

Patrick
Back to top
View user's profile Send private message Visit poster's website
Rooster
Agent


Joined: Feb 11, 2004
Posts: 16

PostPosted: Fri Dec 03, 2004 6:48 pm    Post subject: Re: macro bug? Reply with quote

Patrick,

Okay nevermind, NeoJ wasn't the problem. When I copied the macros to the 1.1 Library, I had tried putting my macro in with the TextToColumns macro's Library and there was something in there that broke it (maybe Option Explicit at the beginning-- I'm not sure). Regardless, if I put it in the Standard Library, it works fine. So, sorry for the trouble, one of these days I'll learn to think faster than I type!

Cheers,
Andrew
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NeoOffice Forum Index -> NeoOffice Testing 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.
Page Generation: 0.02 Seconds