[Libreoffice-bugs] [Bug 133575] comportement anormal d'une macro sous calc

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jun 1 10:19:34 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=133575

--- Comment #2 from Julien Nabet <serval2412 at yahoo.fr> ---
Quick translation:
Two sheets, the second contains the expenses of the month summarized by theme
in column O. A macro copies column O in the column (from 1 to 12) of sheet 1
specified in B1.
Last year the macro worked fine. This year it works for target columns from 1
to 11 but no longer for column 12.
Macro
sub copy
dim lig as integer
dim col as integer
dim fs as object
dim f1 as object
dim f2 as object
Dim Sheet As Object
Dim Cell As Object
 Sun o Leaves
  Sun oSheet
  Dim oCell

  fs = ThisComponent.getSheets ()
 f1 = fs.getByIndex (0)
f2 = fs.getByindex (1)
col = f2.getcellbyposition (1,0) .getvalue ()

Dim Dlg As Object

DialogLibraries.LoadLibrary ("Standard")
Dlg = CreateUnoDialog (DialogLibraries.Standard.diacopie)
Ctl = Dlg.getControl ("num")
Ctl.value = col

Select Case Dlg.Execute ()
Box 1
if col> 0 and col <14 then
for lig = 2 to 22
if lig <> 5 then
f1.getcellbyposition (col, lig) .value = f2.getcellbyposition (13, lig)
.getvalue ()
end if
next
end if

box 0

msgbox ("Exit without doing anything")

end select
end sub

Steps to Reproduce:
1.The range O3: O24 of sheet 2 contains numbers. Cell B1 contains the index of
the column in sheet 1 where this range should be stored.
2.we launch the macro copy
3.this works correctly for B1 = 1 to 11 but not for B1 = 12.

Actual Results:
It seems that the macro copies column N and not column O while the index of the
column to copy is hard in the macro

Expected Results:
copy of column O


Reproducible: Always


User Profile Reset: Yes

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200601/d122a615/attachment.htm>


More information about the Libreoffice-bugs mailing list