Bug 44753 - accesing cells in sheet (calling macro) from called macro
Summary: accesing cells in sheet (calling macro) from called macro
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.5.0 Beta3
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-13 05:34 UTC by jan.benda
Modified: 2012-05-08 03:35 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jan.benda 2012-01-13 05:34:33 UTC
have a qustion abou VBA macros:

How can I access worksheets cells from VBA macro placed in 

[My macros and dialogs].basic (or other library)?

 

Macro below works if is placed in [TestFile.xls].VBAProject but does not

work in [My macros and dialogs].basic. The error message is :

BASIC

runtime error.

'35'

cells

 

Rem Attribute VBA_ModuleType=VBAModule

Option VBASupport 1

 

Sub Test()

Cells(1, 1).Value = Time()

End Sub
Comment 1 sasha.libreoffice 2012-05-08 02:40:53 UTC
reproduced in 3.5.3 on Fedora 64 bit
Comment 2 sasha.libreoffice 2012-05-08 02:42:47 UTC
@ Noel
What do You think about this bug?
Comment 3 Noel Power 2012-05-08 03:10:41 UTC
'Option VBASupport 1'
 
is not enough for vba macros to work, there are many temporary objects and relationships set up as part of importing say an excel document. Some VBA code may work when that option is selected others not, your mileage may vary. ( in general you should just assume vba code will not work at all with native libreoffice documents ) 
As such attempting to run any vba enabled code in application libraries will never work and that is intentional, it makes no sense, VBA for excel/word etc. is in any case document-centric
Comment 4 sasha.libreoffice 2012-05-08 03:21:41 UTC
Thanks for explanations.
But why error 35? May be there should be some text like "VBA not allowed in Library" instead of 35?
Comment 5 Noel Power 2012-05-08 03:35:41 UTC
(In reply to comment #4)
> Thanks for explanations.
> But why error 35? May be there should be some text like "VBA not allowed in
> Library" instead of 35?

it's not that the 'option VBASupport' isn't allowed, it's just that it will not and cannot do anything useful.