Composant de génération de fichiers Excel gratuit
Techniques
Cette section permet de regrouper un ensemble de techniques ou de scripts qui ont l'originalité d'arriver à résoudre une difficulté avec le moindre effort ou qui sont particulièrement efficaces...
Techniques / Composants Excel : DypsXLS
- Composant de génération de fichiers Excel gratuit :
L'exemple suivant vous permettra de vous familiariser avec les objets vus précédemment :
<%
set wbook = createObject("DypsXLS.XLSApplication")
'Create a Workbook Object and set a password
'to make it read-only
'Set wbook = CreateExcelWorkbook()
wbook.password = "myPassword"
' The default font is Tahoma,10
wbook.SetDefaultFont "Tahoma", 9
' Create Worksheets
wbook.AddSheet("FirstSheet")
' SecondSheet is hidden
wbook.AddSheet("SecondSheet",False)
' The sheet name could be ommit in
' order to have the default one
wbook.AddSheet
' Add Sheet and return a XLSWorkSheet object
Set wsheet = wbook.AddSheet("MySheet")
'Get a reference to the second sheet
Set wsheet = wbook.GetSheet(2)
'and similar :
Set wsheet = wbook.GetSheet("SecondSheet")
' Set the scale factor for the sheet (in percent)
wsheet.ScaleFactor = 95
'Set the active sheet when opened
wbook.SetActiveSheet "MySheet"
'' Or
wbook.SetActiveSheet 3
'adding cells to a worksheet
Set cell = wsheet.AddCell(1, 1,"MyValue") 'cell A1
'Use GetCell to retrieve an already existing cell
Set cell = wsheet.GetCell(1, 1) 'Cell A1
cell.value = "4"
'If you have write permission :
wbook.Save server.mapPath("myExcelWork.xls")
%>
<Consulter la référence des objets>
Page suivante
Vous pouvez désormais poser toutes vos questions via le forum. Merci de votre compréhension.
You could now ask for support by using the forum.



