- <%@ LANGUAGE="VBSCRIPT"%>
- <html><head><title>AFFICHAGE FEUILLE EXCEL PAR WIPLILLE</title>
- <meta name="Microsoft Border" content="tb">
- </head>
- <body bgcolor="#FF99CC">
- <%
-
-
-
- ' FUNCTIONS
- ' =========
- Function Nblignes(max)
- i=1
- if (max<0) then max=999 end if
- while ((sheet.Cells(i,1).Value <> "") AND (i<=max))
- i=i+1
- wend
- Nblignes = i - 1
- End Function
- Function Nbcolonnes(max)
- i=1
- if (max<0) then max=999 end if
- while ((sheet.Cells(1,i).Value <> "") AND (i<=max))
- i=i+1
- wend
- Nbcolonnes = i - 1
- End Function
-
- ' CORPS DU SCRIPT
- ' ================
- fichier = "c:\screg\achat1\fournitures.xls"
-
- 'ouvrir excel et fichier
- Set monexcel = CreateObject("Excel.Application")
- monexcel.Workbooks.Open fichier
- Set sheet = monexcel.ActiveWorkbook.Sheets(1)
- maxlignes = 100
- maxcolonnes = 100
- sline = Nblignes(maxlignes)
- scol = Nbcolonnes(maxcolonnes)
- %>
-
- <font color="#808080">
-
- Le fichier est ouvert.<br><br>
- <% If sline < maxlignes then %>
- Il contient <%=sline %> lignes (avant la première case vide dans la colonne 1) <br>
- <% Else %>
- Ce fichier contient au moins <%= maxlignes %> lignes et nous n'allons afficher que les <%=maxlignes %> premières.
- <br>
- <% End If %>
- <% If scol < maxcolonnes then %>
- Il contient <%=scol %> colonnes (avant la première case vide dans la ligne 1) <br><br>
- <% Else %>
- Ce fichier contient au moins <%= maxcolonnes %> colonnes et nous n'allons afficher que les <%=maxcolonnes %> premières</font><font color="#FFFFFF">
- <br></font><br>
- <% End If %>
-
- <table border=2>
- <tr>
- <th> achat </th>
- <th> fournitures </th>
- </tr>
- <% For i =1 to sline %>
- <tr>
- <% For j = 1 to scol %>
- <td>
- <% Response.Write sheet.Cells(i,j) %>
- </td>
- <% Next %>
- </tr>
- <% Next %>
- </table>
- <br> <br> <br> <font color="#808080"> On a affiché le contenu de la base<br> <br>
-
- <%
- 'monexcel.ActiveWorkbook.Save
- monexcel.ActiveWorkbook.Close
- monexcel.Application.Quit
- Set monexcel = Nothing
- %>
- Le fichier est maintenant fermé.</font>
- </body>
- </html>
<%@ LANGUAGE="VBSCRIPT"%>
<html><head><title>AFFICHAGE FEUILLE EXCEL PAR WIPLILLE</title>
<meta name="Microsoft Border" content="tb">
</head>
<body bgcolor="#FF99CC">
<%
' FUNCTIONS
' =========
Function Nblignes(max)
i=1
if (max<0) then max=999 end if
while ((sheet.Cells(i,1).Value <> "") AND (i<=max))
i=i+1
wend
Nblignes = i - 1
End Function
Function Nbcolonnes(max)
i=1
if (max<0) then max=999 end if
while ((sheet.Cells(1,i).Value <> "") AND (i<=max))
i=i+1
wend
Nbcolonnes = i - 1
End Function
' CORPS DU SCRIPT
' ================
fichier = "c:\screg\achat1\fournitures.xls"
'ouvrir excel et fichier
Set monexcel = CreateObject("Excel.Application")
monexcel.Workbooks.Open fichier
Set sheet = monexcel.ActiveWorkbook.Sheets(1)
maxlignes = 100
maxcolonnes = 100
sline = Nblignes(maxlignes)
scol = Nbcolonnes(maxcolonnes)
%>
<font color="#808080">
Le fichier est ouvert.<br><br>
<% If sline < maxlignes then %>
Il contient <%=sline %> lignes (avant la première case vide dans la colonne 1) <br>
<% Else %>
Ce fichier contient au moins <%= maxlignes %> lignes et nous n'allons afficher que les <%=maxlignes %> premières.
<br>
<% End If %>
<% If scol < maxcolonnes then %>
Il contient <%=scol %> colonnes (avant la première case vide dans la ligne 1) <br><br>
<% Else %>
Ce fichier contient au moins <%= maxcolonnes %> colonnes et nous n'allons afficher que les <%=maxcolonnes %> premières</font><font color="#FFFFFF">
<br></font><br>
<% End If %>
<table border=2>
<tr>
<th> achat </th>
<th> fournitures </th>
</tr>
<% For i =1 to sline %>
<tr>
<% For j = 1 to scol %>
<td>
<% Response.Write sheet.Cells(i,j) %>
</td>
<% Next %>
</tr>
<% Next %>
</table>
<br> <br> <br> <font color="#808080"> On a affiché le contenu de la base<br> <br>
<%
'monexcel.ActiveWorkbook.Save
monexcel.ActiveWorkbook.Close
monexcel.Application.Quit
Set monexcel = Nothing
%>
Le fichier est maintenant fermé.</font>
</body>
</html>