|
![](/images/resource/spacer.gif) |
|
อยากได้ตัวอย่างการเขียน Asp ดึงข้อมูลจาก Microsoft Excel มาแสดงผลค่ะ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
Code (ASP)
<% Option Explicit %>
<html>
<head>
<title>ThaiCreate.Com ASP Excel.Application Tutorial</title>
</head>
<body>
<%
Dim xlApp,xlBook,xlSheet1,OpenFile,i
OpenFile = "MyXls/MyExcelDB.xls"
'*** Create Exce.Application ***'
Set xlApp = Server.CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(Server.MapPath(OpenFile))
Set xlSheet1 = xlBook.Worksheets(1)
%>
<table width="420" border="1">
<%For i = 1 To 5%>
<tr>
<td><%=xlSheet1.Cells.Item(i,1)%></td>
<td><%=xlSheet1.Cells.Item(i,2)%></td>
<td><%=xlSheet1.Cells.Item(i,3)%></td>
<td><%=xlSheet1.Cells.Item(i,4)%></td>
</tr>
<%Next%>
</table>
<%
xlApp.Application.Quit
'*** Quit and Clear Object ***'
Set xlSheet1 = Nothing
Set xlBook = Nothing
Set xlApp = Nothing
%>
</body>
</html>
Ref : https://www.thaicreate.com/asp/asp-read-excel.html
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2009-04-26 10:29:56 |
By :
webmaster |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 04
|