[Solved] Error with progress bar in Apache OO 4.1.2 macro

Keyboard macros or custom scripts

[Solved] Error with progress bar in Apache OO 4.1.2 macro

Postby pranjal_ds » Fri Nov 27, 2020 9:19 am

Hi,

I am trying to implement Progress bar in my Apache Open office 4.1.2 macro but getting error "Basic runtime error. Property or method not found: Dialog1."
Attached is the error screenshot.
My code is as below:

Code: Select all   Expand viewCollapse view
Sub ProgressBarDemo()
   Dim oProgressBar as Object, oProgressBarModel As Object, oDialog as Object
   Dim ProgressValue As Long
   REM Dialog1 contains progress bar ProgressBar1 saved in standard library
   DialogLibraries.loadLibrary("Standard")
   oDialog = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
   REM progress bar settings
   Const ProgressValueMin = 0
   Const ProgressValueMax = 40
   Const ProgressStep = 4
   REM set minimum and maximum progress value
   oProgressBarModel = oDialog.getModel().getByName( "ProgressBar1" )
   oProgressBarModel.setPropertyValue( "ProgressValueMin", ProgressValueMin)
   oProgressBarModel.setPropertyValue( "ProgressValueMax", ProgressValueMax)
   REM show progress bar
   oDialog.setVisible( True )
   REM increase progress value every second
   For ProgressValue = ProgressValueMin To ProgressValueMax Step ProgressStep
      oProgressBarModel.setPropertyValue( "ProgressValue", ProgressValue )
      Wait 1000
   Next ProgressValue
End Sub
Attachments
SS1.jpg
Error while running progress bar
Last edited by RoryOF on Fri Nov 27, 2020 5:46 pm, edited 1 time in total.
Reason: Added [Solved] and green tick [RoryOF, Moderator]
Apache Open Office 4.1.2, OS Windows 7
pranjal_ds
 
Posts: 11
Joined: Sun Nov 15, 2020 7:14 am

Re: Error while implementing progress bar in Apache OO 4.1.2

Postby RoryOF » Fri Nov 27, 2020 10:11 am

Apache OpenOffice 4.1.10 on Xubuntu 20.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 32702
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Error while implementing progress bar in Apache OO 4.1.2

Postby pranjal_ds » Fri Nov 27, 2020 11:28 am

Hi RoryOF,

Using the given link code I am able to implement the progress in the status bar.

But is there a solution to my error given in previous post to implement the progress bar?

Please check and suggest.

Regards,
Apache Open Office 4.1.2, OS Windows 7
pranjal_ds
 
Posts: 11
Joined: Sun Nov 15, 2020 7:14 am

Re: Error while implementing progress bar in Apache OO 4.1.2

Postby Bidouille » Fri Nov 27, 2020 12:37 pm

pranjal_ds wrote:Please check and suggest.

Without your document, we can not.

Check yourself if Dialog1 exists when you call it.
User avatar
Bidouille
Volunteer
 
Posts: 449
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: Error while implementing progress bar in Apache OO 4.1.2

Postby pranjal_ds » Fri Nov 27, 2020 12:52 pm

Hi Bidouille,

Attached along with is my code file.
Progrss bar code is in Module4.

Please check and suggest.
Attachments
Timeshet Details OpenOffice.ods
Progrss bar code file.
(37.56 KiB) Downloaded 70 times
Apache Open Office 4.1.2, OS Windows 7
pranjal_ds
 
Posts: 11
Joined: Sun Nov 15, 2020 7:14 am

Re: Error while implementing progress bar in Apache OO 4.1.2

Postby JeJe » Fri Nov 27, 2020 1:48 pm

You don't have a dialog in that library. If I add one with a progress bar it works.
Openoffice 4.1.6
Windows 8
JeJe
Volunteer
 
Posts: 1567
Joined: Wed Mar 09, 2016 2:40 pm

Re: Error while implementing progress bar in Apache OO 4.1.2

Postby pranjal_ds » Fri Nov 27, 2020 2:54 pm

Hi JeJe,

Please let me know how to add a progress bar?

Regards,
Apache Open Office 4.1.2, OS Windows 7
pranjal_ds
 
Posts: 11
Joined: Sun Nov 15, 2020 7:14 am

Re: Error while implementing progress bar in Apache OO 4.1.2

Postby JeJe » Fri Nov 27, 2020 3:02 pm

The toolbox toolbar in the IDE has a list of controls... the label, textbox, progress bar...

Attached is your document with it added.
Attachments
Timeshet Details OpenOffice.ods
(38.18 KiB) Downloaded 67 times
Openoffice 4.1.6
Windows 8
JeJe
Volunteer
 
Posts: 1567
Joined: Wed Mar 09, 2016 2:40 pm

Re: Error while implementing progress bar in Apache OO 4.1.2

Postby pranjal_ds » Fri Nov 27, 2020 5:45 pm

Thank you.
My problem is resolved now.

You can close this forum.

Regards,
Apache Open Office 4.1.2, OS Windows 7
pranjal_ds
 
Posts: 11
Joined: Sun Nov 15, 2020 7:14 am


Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: No registered users and 4 guests