In my app I offer users possibility to export to Excel.
Using automation I give all columns auto-fit width.
Due to this adjustments Excel is asking if I want to keep the changes.
I of course always will.
Would it be possible, prior to have the excel-sheet possible, to save this sheet without any Q.
KR
-Bart
This my code:
Using automation I give all columns auto-fit width.
Due to this adjustments Excel is asking if I want to keep the changes.
I of course always will.
Would it be possible, prior to have the excel-sheet possible, to save this sheet without any Q.
KR
-Bart
This my code:
Code:
IF LEN(ALLTRIM(thisform.excelselectie))<>0
lcExcelName = PUTFILE("Export naar Excel","","XLS")
IF !EMPTY(lcExcelName)
lcFields = thisform.ExcelSelectie
SET SAFETY off
EXPORT TO &lcExcelName TYPE XL5 FIELDS &lcFields
oExcel = CreateObject("Excel.Application")
oExcel.Workbooks.Open(lcExcelName)
oSheet = oExcel.ActiveSheet
lnFields =OCCURS(",",lcFields) +1
FOR j=1 TO lnFields
osheet.Columns(j).EntireColumn.Autofit
ENDFOR
oExcel.Visible = .T.
ENDIF
ELSE
=MESSAGEBOX("Geen informatie gevonden om te exporteren naar Excel",0,_screen.caption)
ENDIF