| View previous topic :: View next topic |
| Author |
Message |
lrufus Power User

Joined: 06 Jun 2007 Posts: 63 Location: Russia
|
Posted: Fri Nov 16, 2007 11:28 am Post subject: Problem: BasicProviderImpl::getScript::no script! |
|
|
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 |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Sat Nov 17, 2007 12:14 am Post subject: |
|
|
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 |
|
 |
lrufus Power User

Joined: 06 Jun 2007 Posts: 63 Location: Russia
|
Posted: Sat Nov 17, 2007 3:43 am Post subject: |
|
|
[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 |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Sat Nov 17, 2007 5:39 am Post subject: |
|
|
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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Sat Nov 17, 2007 6:39 am Post subject: |
|
|
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 |
|
 |
lrufus Power User

Joined: 06 Jun 2007 Posts: 63 Location: Russia
|
Posted: Sun Nov 18, 2007 1:12 am Post subject: |
|
|
| 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 |
|
 |
lrufus Power User

Joined: 06 Jun 2007 Posts: 63 Location: Russia
|
Posted: Sun Nov 18, 2007 1:13 am Post subject: |
|
|
| 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 |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Sun Nov 18, 2007 1:46 am Post subject: Re: Problem: BasicProviderImpl::getScript::no script! |
|
|
| 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 |
|
 |
lrufus Power User

Joined: 06 Jun 2007 Posts: 63 Location: Russia
|
Posted: Sun Nov 18, 2007 2:18 am Post subject: Re: Problem: BasicProviderImpl::getScript::no script! |
|
|
| 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 |
|
 |
lrufus Power User

Joined: 06 Jun 2007 Posts: 63 Location: Russia
|
Posted: Sun Nov 18, 2007 8:18 am Post subject: |
|
|
| 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 |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Sun Nov 18, 2007 9:35 am Post subject: |
|
|
| lrufus wrote: | | So how can I do assigh macro to this event? |
Menu Tools > Personalize > Events tab |
|
| Back to top |
|
 |
lrufus Power User

Joined: 06 Jun 2007 Posts: 63 Location: Russia
|
Posted: Sun Nov 18, 2007 9:43 am Post subject: |
|
|
| B Marcelly wrote: | | lrufus wrote: | | So how can I do assigh macro to this event? |
Menu Tools > Personalize > Events tab |
10x |
|
| Back to top |
|
 |
lrufus Power User

Joined: 06 Jun 2007 Posts: 63 Location: Russia
|
Posted: Sun Nov 18, 2007 9:51 am Post subject: |
|
|
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 |
|
 |
|