|
-
Apr 30th, 2008, 06:47 PM
#1
Thread Starter
New Member
[RESOLVED] Convert excel to html with PublishObjects
Hi… I would want to create a sub to export a sheet excel to HTML file. From excel I have recorded the macro while I made “file - saves as page web” and this is the code that has created:
With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, "C:\Page.htm", _
"Report", "", xlHtmlStatic, "Report_28311", "")
.Publish (True)
.AutoRepublish = False
End With
I inserting this code on VB6, but does not work.
Someone can help me to arrange this partof code in order to make it to work in VB6?
Thanks
-
Apr 30th, 2008, 11:47 PM
#2
Frenzied Member
-
May 1st, 2008, 01:25 PM
#3
Re: Convert excel to html with PublishObjects
Welcome to the forums. 
 Originally Posted by mcgnai
I inserting this code on VB6, but does not work.
What does this mean? What happens when you run the code?
-
May 1st, 2008, 04:49 PM
#4
Thread Starter
New Member
Re: Convert excel to html with PublishObjects
 Originally Posted by zeezee
I'am sorry but i haven't see the FAQ section, but i use the search section.
Thank you for give me the link...i view it, but i not found nothing for my question....
-
May 1st, 2008, 04:57 PM
#5
Re: Convert excel to html with PublishObjects
what code are you using in vb6 to work with excel?
you need to create an instance of excel, attach to the specific workbook you want to work with, then run the code to publish the specific sheet
avoid using references to active anything or selection
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
May 3rd, 2008, 06:11 PM
#6
Thread Starter
New Member
Re: Convert excel to html with PublishObjects
Proble resolved....Tank you
-
May 3rd, 2008, 10:34 PM
#7
Frenzied Member
-
May 4th, 2008, 04:37 PM
#8
Thread Starter
New Member
Re: [RESOLVED] Convert excel to html with PublishObjects
path = App.Path
FileHtm = "\Report.htm"
Set wkb = Workbooks.Open(path + filexcel)
With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
path_htm + FileHtm, "Riep", "" _
, xlHtmlStatic, "", "Report")
.Publish (True)
.AutoRepublish = False
End With
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|