On 27/10/11 20:31, August Sodora wrote:
Hello all,
I have been trying to add support for assigning to named ranges in
VBA. There are a couple of ways VBA does this but for now I'm focusing
on something like:
Range("A1:H8").Name = "TestRange"
Currently the Name property on [X/ScVba]Range is readonly. I've
attached a patch which is my first attempt to try and add a setter
the patch looks perfect, committed and pushed. There are some issues
though that I feel are exposed but not directly caused by your patch (
see below )
but
it was suggested that I also attach an xls with a test macro. I know
there is some changing going on with regards to VBA tests; is there a
place I should stick this to execute for now?
have a look at sc/qa/unit/macros-test.cxx
you could add a test to sc/qa/unit/data/xls/TestAddress.xls, or I
suppose you could add a new test ( just add a new entry into the
testInfo array in macros-test.cxx. However at the moment any valuable
test will probably fail
e.g.
Range("A1:H8").Name = "TestRange"
results in an incorrect range being associated with the Name, if you
look at the Insert | Names | Manage dialog the range associate with
"TestRange" is $Sheet1.$B$16
also if you try and use that range with something like
msgbox Range("A1:H8").Address
we currently get an error.
Would you be interested in debugging this behaviour further ? I can help
you with that if you are interested
regards,
Noel
sub foo
Range("A1:H8").Name = "TestRange"
msgbox Range("TestRange").Address
end sub
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.