PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Windev spreadsheet control not saving comments
Windev spreadsheet control not saving comments
Débuté par Mark Gibbs, 22 avr. 2021 12:06 - 6 réponses
Posté le 22 avril 2021 - 12:06
Hi

I have now added a spreadsheet control to my window.

This allows me to read and write cell values without problem.

I can also read cell comments with no problem.

However, if I change or add a comment associated with a cell that isn't saved with the spreadsheet.

This is my code:
SpreadsheetLoad(PSHEET_ss,"h:\test.xlsx",1,psheetLoadDefault)
sComment is string = PSHEET_ss[1,1].Comment.Text
PSHEET_ss["A2"].Comment.Text = sComment + CR + "test2"
PSHEET_ss[3,1] = 3
SpreadsheetSave(PSHEET_ss,"h:\test2.xlsx",psheetOverwriteAllowed)
SpreadsheetClose(PSHEET_ss)

My pc is running Excel 2019 if that has any relevance (although the documentation says you don't need Excel on the pc at all so I'd think not).

Can anyone help?
Thanks
Mark
Posté le 22 avril 2021 - 13:38
Just a little extra info.

The written comment do show up in the spreadsheet control so the .comment.text = part works.

It's the save that doesn't seem to work - it saves the amended values but not the comments

Mark
Membre enregistré
54 messages
Popularité : +2 (2 votes)
Posté le 23 avril 2021 - 15:29
Hello Mark,
use this code:

MyComment is xlsComment
MyComment.Text="SomethingYouWant "+DateSys()+TimeSys()

MY_PSHEET[1,1].Comment=MyComment

Hope this helps
Andrea
Posté le 23 avril 2021 - 16:12
Hi Andrea

I tried your suggestion but as before it does amend the comment in the spreadsheet but the SpreadsheetSave function doesn't save the comment to the new spreadsheet but does save any changed cell values.

Seems like a bug in the SpreadsheetSave function.

Thanks
Mark
Membre enregistré
54 messages
Popularité : +2 (2 votes)
Posté le 27 avril 2021 - 11:43
Hi Mark,
I actually noticed that it behaves strangely with "comments"
What version are you using?
I used V25 for my tests
I didn't tried with V26 yet
Posté le 30 avril 2021 - 13:28
Hi Andrea

I'm using v25

Thanks
Mark
Posté le 03 mai 2021 - 16:29
Hi

PC Soft support have acknowledged that it doesn't behave as it should and are referring rhe issue to thw developers.

Mark