PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → I can't create a new XLS file
I can't create a new XLS file
Débuté par Massimo Damiani, 30 sep. 2014 09:39 - 4 réponses
Posté le 30 septembre 2014 - 09:39
I need to create an XLS file from my code but i can't.

There is another similar post <a class="ExternalLink" rel="nofollow" target="_blank" href="http://27130.foren.mysnip.de/read.php?27131,124893,124930#msg-124930">http://27130.foren.mysnip.de/read.php&hellip;</a> but i ca'nt.

Can someone send me the exactly code to create a new XLS file using xlsDocument ?

I'm using Windev 18.

Thank you,
Massimo
Posté le 30 septembre 2014 - 10:09
Hi,

In WD16, it works with this code :

myDoc is a xlsDocument

xlsAddWorksheet(myDoc,"Sheet1")
myDoc[3,"A"] = "blabla"
xlsSave(myDoc,"c:\ est.xls")
xlsClose(myDoc)

Regards,
Bart
Posté le 30 septembre 2014 - 10:14
Hi Bart,
it's perfect !!!!!!

Thank you and best regards...
Massimo
Posté le 30 septembre 2014 - 10:22
mayby give this a try, i used in WD18
we save first an template an then open it to put some data to

lv_CopyOK = fCopieFichier(lv_FileCopyFrom,lv_FileCopyTo)

XLS>>Visible = OLEFalse
XLS>>Workbooks>>Open(lv_FilePathComplete)
XLS>>Sheets(1)>>select
XLS>>Range("A3")>>value = "blabla"
XLS>>Visible = OLEFalse
XLS>>ActiveWorkbook>>SAVE
XLS>>ActiveWorkbook>>Close(False)
XLS>>Quit() /

Marc :cool:
Posté le 30 septembre 2014 - 11:59
I'll try it.

Thnank you Marc.

Bye bye,
Massimo