Bug 133575 - comportement anormal d'une macro sous calc
Summary: comportement anormal d'une macro sous calc
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.4.2.1 rc
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-01 09:43 UTC by serge.verdu
Modified: 2021-01-30 04:18 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 serge.verdu 2020-06-01 09:43:21 UTC
Description:
Deux feuilles, la seconde contient les dépenses du mois synthétisées par thème dans la colonne O. Une macro copie la colonne O dans la colonne (de 1 à 12) de la feuille 1 spécifiée en B1.
L'année dernière la macro fonctionnait correctement. Cette année elle fonctionne pour les colonnes cibles de 1 à 11 mais plus pour la colonne 12.
La macro
sub copie
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   
 Dim oFeuilles
  Dim oFeuille
  Dim oCellule
  
  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() 
Case 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

case 0

msgbox("Sortie sans rien faire")

end select 
end sub

Steps to Reproduce:
1.La plage O3:O24 de la feuille 2 contient des nombres. La cellule B1 contient l'index de la colonne de la feuille 1 où il faut ranger cette plage.
2.on lance la macro copie
3.cela foctionne correctement pour B1=1 à 11 mais pas pour B1=12.

Actual Results:
Il semble que la macro copie la colonne N et non la colonne O alors que l'index de la colonne à copier est en dur dans la macro

Expected Results:
copie de la colonne O


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
[Information automatically included from LibreOffice]
Locale: fr
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no
Comment 1 Julien Nabet 2020-06-01 10:15:43 UTC
Could you upgrade to LO 6.4.4 and give a new try?

If you still reproduce this, would it be possible you attach the file with macro? Of course, sanitize your file since I suppose it contains personal info (see https://wiki.documentfoundation.org/QA/Bugzilla/Sanitizing_Files_Before_Submission)

Finally, please try to speak English so more people may help.
Comment 2 Julien Nabet 2020-06-01 10:19:34 UTC
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
Comment 3 Julien Nabet 2020-06-01 12:00:15 UTC
Please don't send email in private but use bugtracker.

I gave a try with master sources updated today, when using "12" in B1 of second sheet, macro "copie" puts several "0" in columns 12 of sheet 1. Idem if I use "B1" =1 or 2, etc.
Taking a look at the macro, it's expected it copies "0" since column N of sheet 2 contains no value.
Comment 4 Xisco Faulí 2020-07-02 09:24:56 UTC
(In reply to Julien Nabet from comment #3)
> Please don't send email in private but use bugtracker.
> 
> I gave a try with master sources updated today, when using "12" in B1 of
> second sheet, macro "copie" puts several "0" in columns 12 of sheet 1. Idem
> if I use "B1" =1 or 2, etc.
> Taking a look at the macro, it's expected it copies "0" since column N of
> sheet 2 contains no value.

Hello Serge,
Please update the macro accordingly as suggested by Julien and come back to us
Comment 5 QA Administrators 2020-12-30 03:39:36 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2021-01-30 04:17:59 UTC
Dear serge.verdu,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp