LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Export to excel via webpage: "Invalid Procedure Call or Argument"

Hi all,
I have a simple HTML table:

<table id="ResultTable"
<tr<tdTEST</td</tr
</table


Then I put a button to export to Excel
<INPUT TYPE="Button" value="Export2Excel" onclick="Export()"


The function:

<script language="vbscript"
Sub Export
Dim sHTML, oExcel, oBook

sHTML = document.all.item("ResultTable").outerhtml

Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add

oExcel.Visible = true
oExcel.UserControl = true

oBook.HTMLProject.HTMLProjectItems("Sheet1").Text = sHTML
oBook.HTMLProject.RefreshDocument

Set oBook = nothing
Set oExcel = nothing
End Sub

</script

This works OK in some computers but on other computers I get error "Invalid
Procedure call or Argument"
It doesn´t work in several computers!!
The error points to
oBook.HTMLProject.HTMLProjectItems("Sheet1").Text = sHTML

How can I solve this?

All the computers don't have add-ons in C:\Program Files\Microsoft
Office\OFFICE11\XLSTART

It's Excel 2003 SP3

Thank you very much

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Procedure call or Argument when Export to Excel via web pa Bruno Excel Programming 0 March 18th 08 02:55 PM
Invalid Procedure Call Or Argument with VBScript [email protected] Excel Programming 0 November 28th 07 01:50 PM
Pivot Table Creation Macro fails with Error #5 "Invalid procedure call or argument" [email protected] Excel Programming 1 July 10th 07 08:01 PM
Invalid Procedure call or argument T De Villiers[_58_] Excel Programming 1 July 25th 06 03:01 PM
bizarre "invalid procedure call" error PatFinegan[_14_] Excel Programming 11 July 13th 04 07:56 PM


All times are GMT +1. The time now is 01:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"