Wrox Programmer Forums
VB Components Issues specific to components in VB.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 19th, 2004, 12:54 AM
Registered User
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Run-time error '1004':

    I have created an excel object variable(objExcel) using CreateObject("Excel.Application"). I tried to published an excel file using this object which is having a pivot table, to a .htm file. When I am trying to execute the statment
objExcel.Application.ActiveWorkbook.PublishObjects .Add(xlSourcePivotTable, htmFile, "CI", "CI", xlHtmlList).Publish , it throws an error

Run-time error '1004':
Application-defined or object-defined error.

However, when I gave excel object reference and declared the object variable then it worked fine.

Can anybody provide solution for this problem.

Thanks & Regards,

Old July 18th, 2004, 11:02 AM
Registered User
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Be sure that you load the Microsoft Excel Worksheet insertable object.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
run-time error(s) Chacko C++ Programming 0 March 4th, 2007 02:28 PM
Run time error 1004 Ken Matthews Excel VBA 1 March 2nd, 2007 06:30 AM
Run-time error '1004' Document not saved Tucky Excel VBA 0 October 28th, 2004 12:04 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.