r_kar
asked on
Export to excel problem
Hi all,
I have script, which is used to export the table information to the excel file.
The code is working fine in client machine (I am using Windows XP & IE 6.0). If I test the same html page in other hosting server, its not downloading(not open the excel file with data).
What's the issue in that?
My code is given below:
<html>
<head>
<title>Testing</title>
</head>
<body>
<script language="vbscript">
Sub exporttoexcel
Dim sHTML
Dim oExcel
Dim oBook
sHTML = document.all.item("inner_t able").out erhtml
Set oExcel = CreateObject("Excel.Applic ation")
Set oBook = oExcel.Workbooks.Add
oBook.HTMLProject.HTMLProj ectItems(" Sheet1").T ext = sHTML
oBook.HTMLProject.RefreshD ocument
oExcel.Visible = true
oExcel.UserControl = true
End Sub
</script>
<table border = 0 cell padding = 0>
<tr>
<td><font size = -1><a href='javascript:exporttoe xcel()'>Ex port To Excel</a></td>
</tr>
</table>
<table id ="inner_table">
<tr><td> Hello</td></tr>
</table>
</body>
</html>
I have script, which is used to export the table information to the excel file.
The code is working fine in client machine (I am using Windows XP & IE 6.0). If I test the same html page in other hosting server, its not downloading(not open the excel file with data).
What's the issue in that?
My code is given below:
<html>
<head>
<title>Testing</title>
</head>
<body>
<script language="vbscript">
Sub exporttoexcel
Dim sHTML
Dim oExcel
Dim oBook
sHTML = document.all.item("inner_t
Set oExcel = CreateObject("Excel.Applic
Set oBook = oExcel.Workbooks.Add
oBook.HTMLProject.HTMLProj
oBook.HTMLProject.RefreshD
oExcel.Visible = true
oExcel.UserControl = true
End Sub
</script>
<table border = 0 cell padding = 0>
<tr>
<td><font size = -1><a href='javascript:exporttoe
</tr>
</table>
<table id ="inner_table">
<tr><td> Hello</td></tr>
</table>
</body>
</html>
vbscript is a microsoft technology so as I know only microsoft OS supports
ASKER
MacroLand,
If I open this page using my IE explorer, it should work... right?
Its not working if I use IE browser in my XP machine.
Anyone can tell me what's happening at that end?
Thanks
If I open this page using my IE explorer, it should work... right?
Its not working if I use IE browser in my XP machine.
Anyone can tell me what's happening at that end?
Thanks
I use your code with IE on my xp machine and it works fine. However with FireFox it does not work.
The reason I guess is your script uses document.all which is Microsoft supported instead of document.getElementById which is Mozilla supported.
The reason I guess is your script uses document.all which is Microsoft supported instead of document.getElementById which is Mozilla supported.
ASKER
MacroLand,
ok.
My problem is if I use same script in some other server (like geocities), it will not work properly.
But If I copy the code using "View Source" and tested, its working.
So what's happening in both case? No idea.... I am using same browser for both testing....
Thanks
ok.
My problem is if I use same script in some other server (like geocities), it will not work properly.
But If I copy the code using "View Source" and tested, its working.
So what's happening in both case? No idea.... I am using same browser for both testing....
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
MacroLand,
Thanks for your reply.
Is there anyway to resolve this issue?
Or do you have any sample script to download the table information as excel file?
Regards
Thanks for your reply.
Is there anyway to resolve this issue?
Or do you have any sample script to download the table information as excel file?
Regards
>>Is there anyway to resolve this issue?
I think you can set your security setting to download ActiveX controls but this is totally up to you. You will be more susceptible to intrusions by this way.
Unfortunately I have no source code for this. I right click the mouse and choose Export to Excel function provided by IE which works fine for me. Sorry.
Regards,
I think you can set your security setting to download ActiveX controls but this is totally up to you. You will be more susceptible to intrusions by this way.
Unfortunately I have no source code for this. I right click the mouse and choose Export to Excel function provided by IE which works fine for me. Sorry.
Regards,
ASKER
Hi all,
I think its difficult to get a solution for my problem. For the time being, I will do it in server side.
I am going to Delete/Cancel this question with all your permission.
Regards
I think its difficult to get a solution for my problem. For the time being, I will do it in server side.
I am going to Delete/Cancel this question with all your permission.
Regards