OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Problem: BasicProviderImpl::getScript::no script!

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
lrufus
Power User
Power User


Joined: 06 Jun 2007
Posts: 63
Location: Russia

PostPosted: Fri Nov 16, 2007 11:28 am    Post subject: Problem: BasicProviderImpl::getScript::no script! Reply with quote

I have problems with my document. I have macros there wich should work when I open this document. (Macros Workbook_Open). Instead then I open my document I have message "BasicProviderImpl::getScript::no script!"
What I did wrong?
Back to top
View user's profile Send private message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1414
Location: France

PostPosted: Sat Nov 17, 2007 12:14 am    Post subject: Reply with quote

Hello,

We can't help you if you don't give sufficient information.

Is your document a Microsoft Word or Excel document containing VBA macros ?

What exact application do you use ? OpenOffice.org downloaded from the original site ? Which version ?

Current OpenOffice.org cannot run VBA macros.
______
Bernard
Back to top
View user's profile Send private message Visit poster's website
lrufus
Power User
Power User


Joined: 06 Jun 2007
Posts: 63
Location: Russia

PostPosted: Sat Nov 17, 2007 3:43 am    Post subject: Reply with quote

[quote="B Marcelly"]Hello,

We can't help you if you don't give sufficient information.

Is your document a Microsoft Word or Excel document containing VBA macros ?

What exact application do you use ? OpenOffice.org downloaded from the original site ? Which version ?

Current OpenOffice.org cannot run VBA macros.
______
Bernard[/quote
I have Excel document. Ooversion is 2.2.1.
This macros works with other documents (I mean MS Excel doc's opened under OO).
I have some files with macroses wich should work under Excel and under OO.
It's like this:
Code:

Sub Workbook_open()
 If WhatIsIt Then
   Workbook_OpenOO
 else
   Workbook_OpenMSO
 End If
End sub

Sub Workbook_OpenMSO
 rem do something under MSO
End Sub

Sub Workbook_OpenOO
 rem do something under OO
End Sub



WhatIsIt - function that can help us to know, what do we use: MSO or OO.
Code:

Function WhatIsit() As Boolean
On Error GoTo ItsMSO
ThisComponent.NamedRanges
WhatIsIt = True
GoTo Last:

ItsMSO:
WhatIsIt = False
Last:
End Function


Maybe it's not very good code, but it works in some files, but in some other files I have an error.
Back to top
View user's profile Send private message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1414
Location: France

PostPosted: Sat Nov 17, 2007 5:39 am    Post subject: Reply with quote

In each document that doesn't work, assign again the correct macro to the "document opening" event.

The macros should be stored either in "My Macros" or in each document.

______
Bernard
Back to top
View user's profile Send private message Visit poster's website
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Sat Nov 17, 2007 6:39 am    Post subject: Reply with quote

Your function WhatIsIt will return True for all spreadsheet documents.
Try this instead:
Code:

Sub test_ArgValue
print getArgumentValue(thisComponent, "FilterName")
end sub

Function getArgumentValue(oDoc, argName$)
args() = oDoc.getArgs()
iUB = uBound(args())
for i = 0 to iUB
   if args(i).Name = argName then exit for
next
' return Basic Empty on error
on error resume next
   getArgumentValue = args(i).Value
End Function
Back to top
View user's profile Send private message
lrufus
Power User
Power User


Joined: 06 Jun 2007
Posts: 63
Location: Russia

PostPosted: Sun Nov 18, 2007 1:12 am    Post subject: Reply with quote

B Marcelly wrote:
In each document that doesn't work, assign again the correct macro to the "document opening" event.

The macros should be stored either in "My Macros" or in each document.

______
Bernard

There can I do this?
Back to top
View user's profile Send private message
lrufus
Power User
Power User


Joined: 06 Jun 2007
Posts: 63
Location: Russia

PostPosted: Sun Nov 18, 2007 1:13 am    Post subject: Reply with quote

Villeroy wrote:
Your function WhatIsIt will return True for all spreadsheet documents.
Try this instead:
Code:

Sub test_ArgValue
print getArgumentValue(thisComponent, "FilterName")
end sub

Function getArgumentValue(oDoc, argName$)
args() = oDoc.getArgs()
iUB = uBound(args())
for i = 0 to iUB
   if args(i).Name = argName then exit for
next
' return Basic Empty on error
on error resume next
   getArgumentValue = args(i).Value
End Function

Of course, in OpenOffice it will be always true. In Microsoft Office it will be always false. But I need it.
Back to top
View user's profile Send private message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1414
Location: France

PostPosted: Sun Nov 18, 2007 1:46 am    Post subject: Re: Problem: BasicProviderImpl::getScript::no script! Reply with quote

lrufus wrote:
I have problems with my document. I have macros there wich should work when I open this document. (Macros Workbook_Open). Instead then I open my document I have message "BasicProviderImpl::getScript::no script!"
What I did wrong?

Thinking again with the information you have given, the reason is probably :
- you have created your macros with Excel
- you are now opening this Excel document with OpenOffice.

The official OpenOffice puts all VBA macros into comments when reading the Excel document. So they do not exist for OpenOffice.

There is no solution except maybe using the Novell version of OpenOffice.

Users with the current official version (2.3.0) of OpenOffice cannot use macros written from Excel or Word. And macros written in OOoBasic are not stored in the document if it is stored as Excel file.
______
Bernard
Back to top
View user's profile Send private message Visit poster's website
lrufus
Power User
Power User


Joined: 06 Jun 2007
Posts: 63
Location: Russia

PostPosted: Sun Nov 18, 2007 2:18 am    Post subject: Re: Problem: BasicProviderImpl::getScript::no script! Reply with quote

B Marcelly wrote:
lrufus wrote:
I have problems with my document. I have macros there wich should work when I open this document. (Macros Workbook_Open). Instead then I open my document I have message "BasicProviderImpl::getScript::no script!"
What I did wrong?

Thinking again with the information you have given, the reason is probably :
- you have created your macros with Excel
- you are now opening this Excel document with OpenOffice.

The official OpenOffice puts all VBA macros into comments when reading the Excel document. So they do not exist for OpenOffice.

There is no solution except maybe using the Novell version of OpenOffice.

Users with the current official version (2.3.0) of OpenOffice cannot use macros written from Excel or Word. And macros written in OOoBasic are not stored in the document if it is stored as Excel file.
______
Bernard

Yes, I know. but in version 2.2.1 all works. I have more than 40 documents. I adapted them for Open Office. And I have such problems just with 6-8 documents.
Back to top
View user's profile Send private message
lrufus
Power User
Power User


Joined: 06 Jun 2007
Posts: 63
Location: Russia

PostPosted: Sun Nov 18, 2007 8:18 am    Post subject: Reply with quote

B Marcelly wrote:
In each document that doesn't work, assign again the correct macro to the "document opening" event.

The macros should be stored either in "My Macros" or in each document.

______
Bernard

So how can I do assigh macro to this event?
Back to top
View user's profile Send private message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1414
Location: France

PostPosted: Sun Nov 18, 2007 9:35 am    Post subject: Reply with quote

lrufus wrote:
So how can I do assigh macro to this event?

Menu Tools > Personalize > Events tab
Back to top
View user's profile Send private message Visit poster's website
lrufus
Power User
Power User


Joined: 06 Jun 2007
Posts: 63
Location: Russia

PostPosted: Sun Nov 18, 2007 9:43 am    Post subject: Reply with quote

B Marcelly wrote:
lrufus wrote:
So how can I do assigh macro to this event?

Menu Tools > Personalize > Events tab

10x
Back to top
View user's profile Send private message
lrufus
Power User
Power User


Joined: 06 Jun 2007
Posts: 63
Location: Russia

PostPosted: Sun Nov 18, 2007 9:51 am    Post subject: Reply with quote

I tried it. No result.
I have an error:
vnd.sun.star.script:Standart.ThisBook.Workbook_Open?language=Basic&Location=document.
BasicProviderImpl::getScript: no script!
But I have this script there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group