OOo Code Sheet Gives Error if password protected

Creating a macro - Writing a Script - Using the API
Post Reply
saurabh42s
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

OOo Code Sheet Gives Error if password protected

Post by saurabh42s »

Hi Guyz,
Please help me ASAP. This is an urgent issue in our project.
My Problem is that i have a sheet, When i protect the code by providing a password then it gives an error "Basic Runtime Error : sub procedure or function procedure not defined". There are 6 tabs in this sheet out of which 4 tabs have add-delete functions so that rows can be added or deleted as per the requirement. Now all is working fine but this runtime error : sub procedure or function procedure not defined is troubling me a lot. When the code is not password protected then the error does not appear.

NOTE: I am using OpenOffice Version 3.3

I am attaching the sheet for refernce.
FORM VAT 11A.zip
(127.56 KiB) Downloaded 331 times
Please help me

password is : formvat11a
Last edited by saurabh42s on Wed Oct 19, 2011 11:45 am, edited 1 time in total.
OpenOffice 3.3 on Windows Vista
User avatar
Zizi64
Volunteer
Posts: 10566
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: OpenOffice Sheet Gives Error When i protect macro with p

Post by Zizi64 »

How we would be able to help you?
We do not know the password ...
We can not see the macro code...
Tibor Kovacs, Hungary; LO6.1.6, 6.4.7 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.1.1;AOO4.1.9
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
saurabh42s
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OpenOffice Sheet Gives Error When i protect macro with p

Post by saurabh42s »

ok, password is : formvat11a
OpenOffice 3.3 on Windows Vista
B Marcelly
Volunteer
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area
Contact:

Re: OpenOffice Sheet Gives Error When i protect macro with p

Post by B Marcelly »

Hi,
Sorry, we don't have a crystal ball. :ucrazy:
Your spreadsheet sheets are protected.
Your macro library is protected.
You don't give us the passwords.
You don't provide any indication of the code where the error appears (you could insert some MsgBox instructions to find out).

I can only see that the library contains many modules with many Sub/Function, and the spreadsheet probably has an Excel origin.

Create a simplified version. Suppress code, suppress sheets, simplify, simplify, until the origin of the problem becomes obvious. That is debugging, the daily chore of a programmer.
Bernard

OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
saurabh42s
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OpenOffice Sheet Gives Error When i protect macro with p

Post by saurabh42s »

i have already given the password for this sheet..(ie : formvat11a)
When You open the spreadsheet then there comes a msgbox saying please do not cut paste any value in the sheet.
Now Error comes immediately after Pressing OK button of the Msgbox and it says "Basic Runtime Error : Sub Procedure or Function procedure not defined."
And most important thing, this error will come only in OpenOffice Version 3.3
OpenOffice 3.3 on Windows Vista
saurabh42s
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OpenOffice Sheet Gives Error When i protect macro with p

Post by saurabh42s »

The reason for protecting macro library is that the error comes only when our macro library is protected.
We have to protect our code because this spreadsheet is of taxation framework and thousands of dealers will be entering their data in it sometime.
OpenOffice 3.3 on Windows Vista
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: OOo Code Sheet Gives Error if password protected

Post by hanya »

It seems VBASupport 1 does not work with password locked library. I got error on Range function. So, re-write without VBASupport or work with un-locked library. I got the same error on LibreOffice 3.4 also.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
saurabh42s
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OOo Code Sheet Gives Error if password protected

Post by saurabh42s »

We can't use Unlocked Library .We have to lock our library.
OpenOffice 3.3 on Windows Vista
saurabh42s
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OOo Code Sheet Gives Error if password protected

Post by saurabh42s »

Mr. Andrew Pitonyak, Can you help me out in this???
Or AnyOne Please....
OpenOffice 3.3 on Windows Vista
User avatar
Villeroy
Volunteer
Posts: 30735
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OOo Code Sheet Gives Error if password protected

Post by Villeroy »

Why don't you simply use Excel with VBA code?
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
saurabh42s
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OOo Code Sheet Gives Error if password protected

Post by saurabh42s »

Dude, we have the same thing with Excel Also, but with Open Office is the requirement of our Client.
So, i was forced to make these sheets in OpenOffice.
:(
OpenOffice 3.3 on Windows Vista
User avatar
Villeroy
Volunteer
Posts: 30735
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OOo Code Sheet Gives Error if password protected

Post by Villeroy »

And now we should do your job or what?
Rewrite the program or tell your client that it is not profitable to do that.
 Edit: The code has been re-written already. There is no need to run it with "Option VBASupport 1".
Apart from that, I don't see any reason to protect such trivial crap. 
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
User avatar
RoryOF
Moderator
Posts: 33583
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: OOo Code Sheet Gives Error if password protected

Post by RoryOF »

Debug it. Either it works with the password or it doesn't; if it doesn't then too bad - raise an issue for OOo developers.
 Edit: useful info on macro passwords at
http://user.services.openoffice.org/en/ ... =20&t=8043
http://user.services.openoffice.org/en/ ... f=20&t=954 
Apache OpenOffice 4.1.12 on Xubuntu 20.04.4 and very infrequently on Win2K/XP
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: OOo Code Sheet Gives Error if password protected

Post by hanya »

Unfortunately, this short code does have problem in password protected library.
Library1.Module1

Code: Select all

Option VBASupport 1
Sub Main
  Range("A1").Value = 100
End Sub
Gets sub-procedure or function procedure not defined.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
User avatar
Villeroy
Volunteer
Posts: 30735
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OOo Code Sheet Gives Error if password protected

Post by Villeroy »

hanya wrote:Unfortunately, this short code does have problem in password protected library.
Someone started the conversion process but did not finish. saurabh42s tries to find some idiot to do his job for free.
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
saurabh42s
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OOo Code Sheet Gives Error if password protected

Post by saurabh42s »

Mr Villeroy.
I am asking here for help and not to do anyone to do my job.
You should think atleast once before saying anything.
OpenOffice 3.3 on Windows Vista
saurabh42s
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OOo Code Sheet Gives Error if password protected

Post by saurabh42s »

Guyz , any solution for this problem????
OpenOffice 3.3 on Windows Vista
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Re: OOo Code Sheet Gives Error if password protected

Post by kingfisher »

I'm very rusty on the subject but I would have thought you need to use Range.getbyName or something of that sort. Paragraph 6.3 of Andrew's macro document may help.
Apache OpenOffice 4.1.9 on Linux
saurabh42s
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OOo Code Sheet Gives Error if password protected

Post by saurabh42s »

Even Range.getbyName is not working here in this case.
:(
OpenOffice 3.3 on Windows Vista
roru
Posts: 1
Joined: Tue Sep 12, 2017 9:32 pm

Re: OOo Code Sheet Gives Error if password protected

Post by roru »

This Error description is very old (2011) but it is'nt fixed at the moment!

If you write long code (> 500 lines) in a library and protect it with a password it works good. But if you save the file and load it again, the code crash at different code lines, i.e. for example a comment line :-) :ucrazy:
There is a memory overflow in OpenOffice. You can split the code in small library parts, then it works again.

Here is a bug description: https://bugs.documentfoundation.org/sho ... i?id=92620 :knock:

In LibreOffice 5.2 they fixed the bug, but in 5.3 it appeared again :crazy:
Last edited by roru on Fri Sep 22, 2017 10:00 pm, edited 1 time in total.
OpenOffice 4.1.3 / LibreOffice 5.2.
Win10
User avatar
RoryOF
Moderator
Posts: 33583
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: OOo Code Sheet Gives Error if password protected

Post by RoryOF »

There may be a memory size limit of 64K to OO library modules. In this posting
viewtopic.php?f=45&t=78105#p357501
Bernard Marcelly, a respected OO macro contributor, says
B Marcelly wrote: In OpenOffice Basic you should not have modules greater than about 60 000 characters. The editor accepts it, but Basic will behave strangely.
Apache OpenOffice 4.1.12 on Xubuntu 20.04.4 and very infrequently on Win2K/XP
Post Reply