Macro Openoffice Calc

Claire -  
bordelaplage Posted messages 16 Registration date   Status Member Last intervention   -
I just transferred an Excel file to OpenOffice, and I had a macro button that allowed me to adjust the row height which no longer works. I wanted to create this macro in OpenOffice Calc, and without knowing Basic, I recorded it. Tools / Macro / Record / then I selected the entire document, and by clicking on a random line break, all the rows adjust, then Finish recording.
Then, when I run the macro, nothing happens. Is this a problem of functionality, language or something else...
Thank you for your help.
Note: If you would like to send me the written macro, I would be happy.

58 answers

  • 1
  • 2
  • 3
lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571
 
Hi,

if you put this option at the beginning of your macro

OPTION VBASupport 1

the VBA code will be able to run on ooopenoffice.org ;-)

so no need for a conversion
--
106485010510997108
7
boyington
 
Hello,
I have the following problem, my entire macro displays 'Rem' at the beginning of each line? And when I correct all the lines without the 'Rem' and then re-edit the macro, everything has returned to the example below?
I have a file "Fabien.XLT"
Thank you

Rem Attribute VBA_ModuleType=VBAFormModule
OPTION VBASupport 1
Sub Command
Rem Private Sub CommandButton6_Click()
Rem
Rem End Sub
Rem
Rem Private Sub CommandButton8_Click()
Rem Sheets("Data").Select
Rem ActiveSheet.Shapes("WordArt 4").Select
Rem Selection.Copy
Rem Sheets("DF").Select
Rem Range("E1").Select
Rem ActiveSheet.Paste
Rem Selection.ShapeRange.IncrementLeft -70.5
Rem Selection.ShapeRange.IncrementTop -8.25
Rem Range("E3").Select
Rem Dim vFichier As String, vChemin As String
Rem vChemin = "d:\FG entreprise\Factures\"
Rem vFichier = vChemin & ("F") & ("_") & ActiveSheet.Range("H1") & ("_") & ActiveSheet.Range("F8")
Rem ActiveWorkbook.SaveAs Filename:=(vFichier)
Rem End Sub
Rem
Rem Private Sub arretroyal_Click()
Rem
Rem End Sub
Rem
Rem Private Sub DEVIS_Click()
Rem Sheets("Data").Select
Rem ActiveSheet.Shapes("WordArt 3").Select
Rem Selection.Copy
Rem Sheets("DF").Select
Rem Range("F1").Select
Rem ActiveSheet.Paste
Rem Selection.ShapeRange.IncrementLeft -76.5
Rem Selection.ShapeRange.IncrementTop -9.75
Rem Selection.ShapeRange.IncrementLeft -3#
Rem Selection.ShapeRange.IncrementTop -0.75
Rem Range("H1:I1").Select
Rem End Sub
Rem
Rem Private Sub devisrenvoyer_Click()
Rem With ActiveSheet.PageSetup
Rem .BlackAndWhite = False
Rem End With
Rem ActiveSheet.PrintOut
Rem With ActiveSheet.PageSetup
Rem .BlackAndWhite = True
Rem End With
Rem ActiveSheet.PrintOut
Rem End Sub
Rem
Rem Private Sub Facture_Click()
Rem Sheets("Data").Select
Rem ActiveSheet.Shapes("WordArt 4").Select
Rem Selection.Copy
Rem Sheets("DF").Select
Rem Range("E1").Select
Rem ActiveSheet.Paste
Rem Selection.ShapeRange.IncrementLeft -35.25
Rem Selection.ShapeRange.IncrementTop -11.25
Rem Range("H1:I1").Select
Rem End Sub
Rem
Rem Private Sub Image1_Click()
Rem
Rem End Sub
Rem
Rem Private Sub print_couleur_bw_Click()
Rem With ActiveSheet.PageSetup
Rem .BlackAndWhite = False
Rem End With
Rem ActiveSheet.PrintOut
Rem With ActiveSheet.PageSetup
Rem .BlackAndWhite = True
Rem End With
Rem ActiveSheet.PrintOut
Rem With ActiveSheet.PageSetup
Rem .BlackAndWhite = False
Rem End With
Rem End Sub
Rem
Rem Private Sub Sfacture_Click()
Rem Dim vFichier As String, vChemin As String
Rem vChemin = "c:\MN entreprise\Factures\"
Rem vFichier = vChemin & ("F") & ("_") & ActiveSheet.Range("H1") & ("_") & ActiveSheet.Range("F8")
Rem ActiveWorkbook.SaveAs Filename:=(vFichier)
Rem End Sub
Rem
Rem Private Sub Svdevis_Click()
Rem Dim vFichier As String, vChemin As String
Rem vChemin = "d:\FG entreprise\Devis\"
Rem vFichier = vChemin & ("D") & ("_") & ActiveSheet.Range("H1") & ("_") & ActiveSheet.Range("F8")
Rem ActiveWorkbook.SaveAs Filename:=(vFichier)
Rem End Sub
Rem
Rem Private Sub TVA21_Click()
Rem ActiveWindow.ScrollRow = 20
Rem Range("G47").Select
Rem Sheets("Data").Select
Rem Range("A4").Select
Rem Selection.Copy
Rem Sheets("DF").Select
Rem ActiveSheet.Paste
Rem Application.CutCopyMode = False
Rem Range("H47:I47").Select
Rem Sheets("Data").Select
Rem Range("B4").Select
Rem Selection.Copy
Rem Sheets("DF").Select
Rem ActiveSheet.Paste
Rem Application.CutCopyMode = False
Rem Sheets("DF").Select
Rem End Sub
Rem
Rem Private Sub TVA6_Click()
Rem Range("G47").Select
Rem Sheets("Data").Select
Rem Range("A3").Select
Rem Selection.Copy
Rem Sheets("DF").Select
Rem ActiveSheet.Paste
Rem Application.CutCopyMode = False
Rem Range("H47:I47").Select
Rem Sheets("Data").Select
Rem Range("B3").Select
Rem Selection.Copy
Rem Sheets("DF").Select
Rem ActiveSheet.Paste
Rem Application.CutCopyMode = False
Rem Range("A48").Select
Rem End Sub
Rem
Rem Private Sub TVACC_Click()
Rem Range("G47").Select
Rem Sheets("Data").Select
Rem Range("A6").Select
Rem Selection.Copy
Rem Sheets("DF").Select
Rem ActiveSheet.Paste
Rem Application.CutCopyMode = False
Rem Range("H47:I47").Select
Rem Sheets("Data").Select
Rem Range("B6").Select
Rem Selection.Copy
Rem Sheets("DF").Select
Rem ActiveSheet.Paste
Rem Application.CutCopyMode = False
Rem Range("B46").Select
Rem Sheets("Data").Select
Rem ActiveSheet.Shapes("AutoShape 1").Select
Rem Selection.Copy
Rem Sheets("DF").Select
Rem ActiveSheet.Paste
Rem Selection.ShapeRange.IncrementLeft 47.25
Rem Selection.ShapeRange.IncrementTop -1.5
Rem Range("A48").Select
Rem End Sub
Rem
Rem Private Sub UserForm_Click()
Rem
Rem End Sub
Rem
End Sub
0
loks
 
Hello everyone!

Yes, I tried OPTION VBASupport 1 and it works great.
However, does it work for all VB programs??
Thanks for your help!!
Meanwhile, I have another question:

Can you help me with a specific point that is really blocking me.
Actually, I can’t execute my macros step by step (let’s say I don’t know at all how to do it on Open Office). If I press F8, I execute a macro (the first one), but then I can’t get out of it and execute the next ones.

Thank you for your attention.
0
lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571 > loks
 
Hi,

does this work for all VB programs??
Don't confuse VB with VBA.

For the second question, a bit more detail is needed.
--
106485010510997108
0
Dark Tigrou Posted messages 1 Registration date   Status Member Last intervention   2
 
It is unfortunately normal... Macros are difficult to import into OpenOffice.
Macros are not managed in the same way because the source code of MS Office formats is not available. Therefore, it requires reprogramming to retrieve the precious macros we use every day... :(

To create your macros, I refer you to the following link that may be helpful: http://perso.wanadoo.fr/pedagologic/documents/MacroOOo.pdf

Hoping this will help you.
2
didou
 
So I have the solution to your problem, it's very simple actually. Once you've done everything, namely the recording and the macro, just go to the button you've created, right-click on it, and go to assign a macro. There you specify which macro it is and confirm with ok, and it should be fine...
There you go, I hope you'll manage, see you soon.
0
marquantdidier Posted messages 4 Registration date   Status Member Last intervention  
 
Hello, the link doesn't work: the page no longer exists.
0
OOoForum Posted messages 3871 Registration date   Status Member Last intervention   965
 
Yes, it's a bit normal when bringing up topics from 2005.
0
Doudou95 Posted messages 1897 Registration date   Status Member Last intervention   275
 
+1 but at least it means that he looks for it before posting :)
0
jackryan195 Posted messages 25 Registration date   Status Member Last intervention   6
 
Good evening everyone
As part of my job, I need to transfer a copy from a Calc sheet to a Writer document at a specific location
The best would be to have a macro in Calc with an action button.
Thank you in advance
2
boyington
 
Hello Lami20j
Would it be possible for me to send you the complete file? And by what means? On the site?
JM
2
lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571
 
Good evening Claire,

Is it a functionality issue, a language issue, or something else..

Yes, it's a language issue. In the MsOffice pack, we use VBA (Visual Basic for Applications) and in Open Office, we use OooBasic.

Here's your macro.
 Sub adjust_rows() ThisComponent.currentController.activeSheet.Rows.Height = 400 End Sub 
The macro adjusts the rows of the active sheet (400 is for a height of 0.40 cm)

If you don't know where to write the code, let me know, I will explain it to you.

lami20j
1
loks
 
Ok, actually it's VBA (what we do with Excel...)

To be clearer on the question, I want to know if with OpenOffice we can use exactly the same codes as in Excel, just adding OPTION VBASupport 1, or if some codes still need to be modified.

Thank you
0
OOoForum Posted messages 3871 Registration date   Status Member Last intervention   965 > loks
 
It's pointless to respond to old topics (2005). At that time, this option didn't exist.

--
<signature>Why hack MS-Office when there's a free solution?
Use OpenOffice.org</signature>
0
loks > OOoForum Posted messages 3871 Registration date   Status Member Last intervention  
 
Hello
Actually, it's not about hacking, it's about doing a good job in the best timeframe.
If I don't finish this project within 3 weeks, I might get fired. Please help me transfer the Excel VBA 2003 files to Open Office 3.0 Basic.
The files are extremely numerous (a company with over 700 employees) and I can't afford to reprogram under Open Office as I'm incapable of doing so (level 0).

When I set OPTION VBASupport 1, I realize that it accepts certain expressions but not others, like Application.Run("Showall"). Help me find a solution.
Thank you.
0
loks > OOoForum Posted messages 3871 Registration date   Status Member Last intervention  
 
Hi

please could you take a look at my file so that you can better understand my question?

thank you
0
Doudou95 Posted messages 1897 Registration date   Status Member Last intervention   275
 
Hello, my problem is the following: I am making a program for "work" and the problem is that until now, even without too much knowledge, I was able to modify the program in Excel and OpenOffice Calc. However, there was a macro in the Excel program (Microsoft) that allowed me to send the file I was on as an attachment to a given address (all this contained in the macro). Knowing that we don't program the same way in OpenOffice Calc, could you please give me the lines of the program since I am at zero level for this :) (Visual Basic for the macro normally) Thank you very much.
1
Bid0uille Posted messages 2 Registration date   Status Member Last intervention  
 
No need for a macro, you have the File / Send menu.
0
loks > Bid0uille Posted messages 2 Registration date   Status Member Last intervention  
 
Salut

Do you want to help me understand why my calculation below doesn't work on Open Office while it works on Excel 2003?

xd = IIf(IsDate(xd), xd, Date)

Thanks
0
lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571 > loks
 
Hi,

Why don't you use an if instead to see
Anyway, IIF corresponds to
If condition Then instruction else instruction end if
--
106485010510997108
0
loks > lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention  
 
Hey

As you said, it's the same, but I don't want to modify my program because it was created by someone else over 10 years ago.
Otherwise, can I send you the file so you can take a look?
0
lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571 > loks
 
Hi,

Upload your file to cjoint.com
I'll take a look tonight.
Also, let me know your version of openoffice.org
--
106485010510997108
0
Doudou95 Posted messages 1897 Registration date   Status Member Last intervention   275
 
Il me le faut sous forme de macro car c'est très important et la version EXCEL (Microsoft) l'a en macro, c'est pour simplifier au maximum, ils cliquent et ça envoie... la macro est sur EXCEL, il me la faut adaptée sur la version CALC (OpenOffice).
1
manaelle
 
Hello,

I have a major problem that is hindering my progress on a very important project.

I have a table, but the content from one cell to another is not the same, so I would like, magically, a blank line to appear whenever the content is different.

Is that possible?

If so, could you please help me?
1
lato
 
Hello
I'm facing the same problem as you: openoffice calc macro

Have you found a solution since 2005?
Thank you for your response
See you
lato716@hotmail.com
1
jackryan195
 
Hello,
Unfortunately, I haven't received any response to my issue and I'm still struggling with my copy/paste.
0
L'Ultime Coiffeur > jackryan195
 
Hello,

What exactly do you want to do because your message is not clear to me...
Do you want to copy an entire Calc sheet to Writer? Or just a part of the sheet?
Do you want to copy a macro? The content of a cell?... etc...

A few more specific details would help to understand your problem =)
0
bruno
 
Bonjour, je suis novice dans la programmation, j'aurais voulu savoir s'il y avait un moyen de transférer d'un tableau Open Office, des données bien précises vers un autre tableau Open Office déjà existant par le biais d'une seule touche autre que copier-coller ou truc du genre. Peut-être avec VB, je n'en sais rien mais bon.
1
OOoForum Posted messages 3871 Registration date   Status Member Last intervention   965
 
Here is an example of code to perform a copy-paste between two workbooks:
https://forum.openoffice.org/fr/forum/ftopic6371.html
Happy coding
--
Why hack MS Office when there is a free solution? Use OpenOffice.org
0
Sipa
 
```plaintext Hello everyone, a big problem for the development of a personal project, need help

I am sending you below a VB macro, which allows me to transpose values into a table in the first empty line. I don't know how to transform it into Ooo BASIC.

Sub transpose_into_table()
'Access a sheet and memorize the data
Sheets("Sheet1").Select
Range("C4:C21").Select
Selection.Copy
'Test to determine the line where to paste the info in the table
Sheets("Sheet2").Select
valueD12 = Range("D12").Value
If valueD12 = "" Then
Range("D12").Select
Else
Range("D11").Select
Selection.End(xlDown).Select
active_row_base = ActiveCell.Row
Range("D" & active_row_base + 1).Select
End If
'Memorize the row number where to paste'
active_row_base = ActiveCell.Row
'Pasting with transposition'
Range("D" & active_row_base).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=True
'Clear the sheet'
Sheets("Sheet1").Select
Range("C4:C10,C12:C21").Select
Selection.ClearContents
Range("C4").Select
'Go to another table'
Sheets("Sheet3").Select
Range("B6").Select
End Sub ```
1
lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571
 
Hi,

You keep the keyword only for comments, but from what I've seen, there are no comments, so you can remove Rem
--
106485010510997108
1
lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571
 
Hi,

Can you upload it on cjoint.com
And send me the link to download it.
--
106485010510997108
1
boyington
 
Thank you Lami20j
I sent it to you, I saved it as MS 97 but I realize it's only about a hundred KB when it's much more?
Shouldn't you have saved it as .ODP?
Thank you
1
lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571
 
Hi,

Well, if it's OpenOffice.org then save it in an OpenOffice.org format.
You can compress the file if it's too large.
--
106485010510997108
1
boyington
 
Good evening Lami20j,
I hope I have sent it in the right format (Template) but it seems a bit light to me!
Have a good evening
JM
1
loks
 
Re,

Thanks for everything you do!!
Unfortunately, my file is apparently too large for cjoint.com, but I deleted several lines to make it manageable and I'm finally sending it in several parts (all are necessary for the macro to work).

https://www.cjoint.com/?ergREklbHk
https://www.cjoint.com/?ergSoNWYBD
https://www.cjoint.com/?ergSLVehjk

These three files are super important so they must be in the correct folder that you will choose.

Then there is the big file (where the macros are) but it is too large for cjoint.com?? Do you have an idea for how I can get it to you? By email, for example?
1
lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571
 
Re,

I'm sending it in several pieces (all are useful for the macro to work).
I'm going to mix things up.
What you sent are CSV files, so I won't have any macros in there.

What I need is to send your Excel file that contains the macros.
I will take care of opening it myself with OpenOffice.

Try to compress your file before sending it.

--
106485010510997108
1
loks
 
Hi,

I'm sorry, you can think I'm useless; that's normal, I think I am because I no longer know how to compress a file?
1
tomylef Posted messages 2 Registration date   Status Member Last intervention  
 
Hello everyone,
I would like to know if it is possible to create a button in OpenOffice Calc that, when clicked, would increment the value of a cell?
In fact, you would first have to click on the cell you want and then click on the button to increment the value of that cell.
Is this possible??
Sincerely
0
Caïndymion Posted messages 1 Registration date   Status Member Last intervention  
 
```html Incrementation
----------------------------------------------------------------------
define variables
dim document as object
dim dispatcher as object
----------------------------------------------------------------------
get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())

----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "StringName"
args2(0).Value = "1"

dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args2())

Ensuite tu as plus qu'a crée un bouton et en lui linkant ta macro pour qu'elle se déclenche quand tu appuie sur le bouton.

Enjoy ;) ```
0
bordelaplage Posted messages 16 Registration date   Status Member Last intervention   1
 
Hello,

I am desperately looking for someone who can help me improve a program already created with OPEN OFFICE 4.0.1 on 2 sheets

I need to extend this unfinished program to the 3rd and 4th sheets

The explanations & files are here:

http://www.technifree.com/modules/newbb/viewtopic.php?start=30&topic_id=1803&viewmode=flat&order=ASC

P.S. Otherwise, can you direct me to other people or sites

This is URGENT please, due to the delays in my research that have been piling up since ........

Thank you for your attention and your help

I am 56 years old, separated, looking for a job

In exchange, I can offer (gift vouchers, PSG jersey Ibrahimovic or Beckham, Harley Davidson alarm clock.........NEW)

If you want to contact me:

s.patrick315@aliceadsl.fr
0
  • 1
  • 2
  • 3