Google Answers Logo
View Question
 
Q: Visual Basic for Application ( No Answer,   0 Comments )
Question  
Subject: Visual Basic for Application
Category: Computers > Programming
Asked by: ash4317-ga
List Price: $15.00
Posted: 11 Feb 2003 15:38 PST
Expires: 13 Mar 2003 15:38 PST
Question ID: 160201
I am using Excel 2002 to create a Web page. My Excel workbook has a
number of sheets but I need to save each sheet as a web page. I have
created a macro and always get an Run-Time Error '1004'
Application-defined or object-defined error
on this line of code:
With ActiveWorkbook.PublishObjects.Add(xlSourceSheet,
"C:\Data\Public\Oracle FSG's\" & a$ & "\Test.htm", "Sheet1", "",
xlHtmlStatic, "Book2_9867", "")
       .Publish (True)
       .AutoRepublish = False
    End With

Request for Question Clarification by mathtalk-ga on 24 Feb 2003 08:52 PST
Hi, ash4317-ga:

I think I've had this kind of problem myself.  It's difficult to
diagnose just looking at the immediate line where the error occurs,
but my guess is that to make the "With ... End With" syntax work, you
should create an "object" variable to how each sheet, then apply the
"With ... End With" syntax to that variable.

To elaborate on the problem slightly, the "object" which you are
apparently trying to "publish" appears to be the worksheet "added"
following the "With" keyword.  Even when an expression returns an
object (which I haven't tried to verify here, since I lack your
setup), one sometimes cannot use that expression in the "With ... End
With" construct because the "return value" is seemingly discarded.

Let me know if you'd like me to post a more detailed version as an
answer.

regards, mathtalk

Clarification of Question by ash4317-ga on 03 Mar 2003 10:06 PST
Please send a detail version.

I am trying to create a web page from my Excel Workbook. My workbook
has several sheets which I need to turn in web pages in separate
folders. I need a macro to accomplish this since my workbook will
change each month.

Thank for help.
ash4317
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy