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.
Macro Errors - basic lang on data type 'range'
-
- Posts: 2
- Joined: Mon Jul 27, 2009 5:42 pm
Macro Errors - basic lang on data type 'range'
OOo 3.1.X on MS Windows Vista + windows xp pro
Re: Macro Errors - basic lang on data type 'range'
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
Your VB code is, I'm sure, different. I posted some links to resources helpful for learning to write OOo macros in this thread
Code: Select all
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")
Last edited by FJCC on Tue Jul 28, 2009 2:51 pm, edited 1 time in total.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
-
- Posts: 2
- Joined: Mon Jul 27, 2009 5:42 pm
Re: Macro Errors - basic lang on data type 'range'
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.
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
Re: Macro Errors - basic lang on data type 'range'
@ FJCC
Even in VBA you've got to program (somehow ). Particularly, you should know about data type "String" when calling anything by name.
getCellrangeByName("A1:A10")
Even in VBA you've got to program (somehow ). Particularly, you should know about data type "String" when calling anything by name.
getCellrangeByName("A1:A10")
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Macro Errors - basic lang on data type 'range'
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.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.