Bug 70754 - Object's references by set expression are messed
Summary: Object's references by set expression are messed
Status: RESOLVED DUPLICATE of bug 70079
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-22 10:01 UTC by Eugenij Shkrigunov
Modified: 2013-11-22 15:46 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
example demonstrating problem (8.69 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-10-22 10:01 UTC, Eugenij Shkrigunov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugenij Shkrigunov 2013-10-22 10:01:02 UTC
Created attachment 87975 [details]
example demonstrating problem

Hi!
Sorry for my English.

LibreOffice-4.1.2.3 has trouble that not exist in previous versions (at least LibreOffice-4.0.4.2).

Workbook of 2 sheets: "Sheet1" and "Sheet2". Cell "A1" of "Sheet1" contains value 42. Object's reference mySheet is messed after adding sheet. First MsgBox correctly reports value 42, but second don't.

Option VBASupport 1
Option Explicit

Dim mySheet

Sub Main
	Set mySheet = Sheets("Sheet1")

	MsgBox("Before copy sheet: " + mySheet.Cells(1, 1).Value)

	Sheets("Sheet2").Copy Before:=Sheets("Sheet1")

	MsgBox("After copy sheet: " + mySheet.Cells(1, 1).Value)
End Sub

Code like above is from file generated by another program beyond our control.
Attachment contains sample file. Try to run macro bug_demo.ods -> Standard -> Module1 -> Main.
Comment 1 Eugenij Shkrigunov 2013-10-23 07:41:56 UTC

*** This bug has been marked as a duplicate of bug 70079 ***