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 - macro bug? (Bugzilla down)
macro bug? (Bugzilla down)
 
   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)

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
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

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

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

Patrick
Back to top
Rooster
Agent


Joined: Feb 11, 2004
Posts: 16

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

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
Display posts from previous:   
   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.