OOo Code Sheet Gives Error if password protected

Creating a macro - Writing a Script - Using the API

OOo Code Sheet Gives Error if password protected

Postby saurabh42s » Wed Oct 19, 2011 9:24 am

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 176 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
saurabh42s
 
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

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

Postby Zizi64 » Wed Oct 19, 2011 10:58 am

How we would be able to help you?
We do not know the password ...
We can not see the macro code...
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.6 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.4; AOO4.1.5
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.
User avatar
Zizi64
Volunteer
 
Posts: 7974
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

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

Postby saurabh42s » Wed Oct 19, 2011 11:44 am

ok, password is : formvat11a
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

Postby B Marcelly » Wed Oct 19, 2011 11:54 am

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
B Marcelly
Volunteer
 
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

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

Postby saurabh42s » Wed Oct 19, 2011 12:09 pm

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

Postby saurabh42s » Wed Oct 19, 2011 12:16 pm

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
saurabh42s
 
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OOo Code Sheet Gives Error if password protected

Postby hanya » Wed Oct 19, 2011 1:55 pm

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
hanya
Volunteer
 
Posts: 884
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: OOo Code Sheet Gives Error if password protected

Postby saurabh42s » Wed Oct 19, 2011 1:58 pm

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

Postby saurabh42s » Wed Oct 19, 2011 2:05 pm

Mr. Andrew Pitonyak, Can you help me out in this???
Or AnyOne Please....
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

Postby Villeroy » Wed Oct 19, 2011 3:05 pm

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, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26734
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OOo Code Sheet Gives Error if password protected

Postby saurabh42s » Wed Oct 19, 2011 3:07 pm

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
saurabh42s
 
Posts: 34
Joined: Wed Oct 19, 2011 7:42 am

Re: OOo Code Sheet Gives Error if password protected

Postby Villeroy » Wed Oct 19, 2011 3:32 pm

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, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26734
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OOo Code Sheet Gives Error if password protected

Postby RoryOF » Wed Oct 19, 2011 3:36 pm

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/forum/viewtopic.php?f=20&t=8043
http://user.services.openoffice.org/en/forum/viewtopic.php?f=20&t=954 
Apache OpenOffice 4.1.6 on Xubuntu 18.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 28948
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: OOo Code Sheet Gives Error if password protected

Postby hanya » Wed Oct 19, 2011 4:55 pm

Unfortunately, this short code does have problem in password protected library.
Library1.Module1
Code: Select all   Expand viewCollapse view
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
hanya
Volunteer
 
Posts: 884
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: OOo Code Sheet Gives Error if password protected

Postby Villeroy » Wed Oct 19, 2011 5:09 pm

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, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26734
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OOo Code Sheet Gives Error if password protected

Postby saurabh42s » Thu Oct 20, 2011 6:21 am

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

Postby saurabh42s » Mon Oct 31, 2011 7:06 am

Guyz , any solution for this problem????
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

Postby kingfisher » Mon Oct 31, 2011 8:39 am

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.6 on PCLinuxOS
User avatar
kingfisher
Volunteer
 
Posts: 2120
Joined: Tue Nov 20, 2007 10:53 am

Re: OOo Code Sheet Gives Error if password protected

Postby saurabh42s » Mon Oct 31, 2011 1:50 pm

Even Range.getbyName is not working here in this case.
:(
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

Postby roru » Tue Sep 12, 2017 10:14 pm

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
roru
 
Posts: 1
Joined: Tue Sep 12, 2017 9:32 pm

Re: OOo Code Sheet Gives Error if password protected

Postby RoryOF » Wed Sep 13, 2017 8:15 am

There may be a memory size limit of 64K to OO library modules. In this posting
https://forum.openoffice.org/en/forum/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.6 on Xubuntu 18.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 28948
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 5 guests