Macro Errors - basic lang on data type 'range'

Discuss the spreadsheet application

Macro Errors - basic lang on data type 'range'

Postby freesoftwarewizard » Mon Jul 27, 2009 5:49 pm

I am trying to use several dozen macros I had for excel.

They all use a dat type called "range" (for cell ranges).

When I run the macros, i get a 'basic" syntax error: "unknown data type range"

Any ideas?

if not, any idea of an easy way to remove rows that have back-to-back duplicate data in a specific column (such as all the 'extra" record that have the same date in column A for rows 4 thru 10) ??

thanks

joe c.
OOo 3.1.X on MS Windows Vista + windows xp pro
freesoftwarewizard
 
Posts: 2
Joined: Mon Jul 27, 2009 5:42 pm

Re: Macro Errors - basic lang on data type 'range'

Postby FJCC » Mon Jul 27, 2009 9:24 pm

I'm not familiar with programming Excel, so I can't certain about your 'range' variable. I do know that you cannot in general port Excel macros to Calc without significant changes. OOobasic is not identical to VB and the underlying API's are just different. For example, to create an object representing a cell range in Calc using OOoBasic, the code could look like

Code: Select all   Expand viewCollapse view
Doc = ThisComponent  'assign the current document to the variable Doc
Sheet = Doc.Sheets.getByName("Sheet1")  'get the sheet named Sheet1
Cellrange = Sheet.getCellrangeBYName("A1:A10")


Your VB code is, I'm sure, different. I posted some links to resources helpful for learning to write OOo macros in this thread
Last edited by FJCC on Tue Jul 28, 2009 2:51 pm, edited 1 time in total.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7353
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Macro Errors - basic lang on data type 'range'

Postby freesoftwarewizard » Tue Jul 28, 2009 8:19 am

the excel macros are actually just vbasic with a few 'extras' "range' is a dimension type.

I'm not really looking to spend a lot of time learning oobasic. just don't know where to find such a basic macro for scalc

but thanks for the reply! :-)

joe c.
OOo 3.1.X on MS Windows Vista + windows xp pro
freesoftwarewizard
 
Posts: 2
Joined: Mon Jul 27, 2009 5:42 pm

Re: Macro Errors - basic lang on data type 'range'

Postby Villeroy » Tue Jul 28, 2009 11:01 am

@ FJCC ;)
Even in VBA you've got to program (somehow :mrgreen: ). Particularly, you should know about data type "String" when calling anything by name.
getCellrangeByName("A1:A10")
:ugeek:
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27295
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Macro Errors - basic lang on data type 'range'

Postby FJCC » Tue Jul 28, 2009 2:50 pm

Doh! Well, that's embarrassing Thanks for the catch, Villeroy! I knew that if I just typed even the simplest code directly into a response without checking it, I would make a mistake.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7353
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA


Return to Calc

Who is online

Users browsing this forum: No registered users and 25 guests