Page 1 of 1

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

PostPosted: Fri Nov 27, 2020 9:19 am
by pranjal_ds
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

Re: Error while implementing progress bar in Apache OO 4.1.2

PostPosted: Fri Nov 27, 2020 10:11 am
by RoryOF

Re: Error while implementing progress bar in Apache OO 4.1.2

PostPosted: Fri Nov 27, 2020 11:28 am
by pranjal_ds
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,

Re: Error while implementing progress bar in Apache OO 4.1.2

PostPosted: Fri Nov 27, 2020 12:37 pm
by Bidouille
pranjal_ds wrote:Please check and suggest.

Without your document, we can not.

Check yourself if Dialog1 exists when you call it.

Re: Error while implementing progress bar in Apache OO 4.1.2

PostPosted: Fri Nov 27, 2020 12:52 pm
by pranjal_ds
Hi Bidouille,

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

Please check and suggest.

Re: Error while implementing progress bar in Apache OO 4.1.2

PostPosted: Fri Nov 27, 2020 1:48 pm
by JeJe
You don't have a dialog in that library. If I add one with a progress bar it works.

Re: Error while implementing progress bar in Apache OO 4.1.2

PostPosted: Fri Nov 27, 2020 2:54 pm
by pranjal_ds
Hi JeJe,

Please let me know how to add a progress bar?

Regards,

Re: Error while implementing progress bar in Apache OO 4.1.2

PostPosted: Fri Nov 27, 2020 3:02 pm
by JeJe
The toolbox toolbar in the IDE has a list of controls... the label, textbox, progress bar...

Attached is your document with it added.

Re: Error while implementing progress bar in Apache OO 4.1.2

PostPosted: Fri Nov 27, 2020 5:45 pm
by pranjal_ds
Thank you.
My problem is resolved now.

You can close this forum.

Regards,