|
-
Jun 8th, 2010, 05:14 AM
#1
Thread Starter
Addicted Member
Save xls as html
I have a spreadsheet which has a graph in it
If I open it in Excel and 'Save as html' it goes though a four-stage wizard and ends up with an html file and the graph saved as a gif
I want to be able to automate this in a VB app
Any ideas?
Thanks
Another light-hearted post from Guru 
-
Jun 8th, 2010, 05:18 AM
#2
Re: Save xls as html
Will Excel be installed on the computer that your code runs on?
If so the easiest way would be to use automate it - see my Excel tutorial (link in my signature) for an explanation of how to do that, particularly the "macro's" section.
-
Jun 8th, 2010, 05:56 AM
#3
Thread Starter
Addicted Member
Re: Save xls as html
Excel will be on the PC
I tried to record a macro but no code was created when saving as html
(I was able to create a simple macro ok as in your example though)
Any ideas?
Thanks
Another light-hearted post from Guru 
-
Jun 8th, 2010, 07:40 AM
#4
Re: Save xls as html
What is the office version that you are using?
I tried this in Off - 2007 and got this macro...
Code:
With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
"C:\Book1.htm", "Sheet1", "", _
xlHtmlStatic, "Book1_4459", "")
.Publish (True)
.AutoRepublish = False
End With
Rest I am sure you will be able to pick up from Si's tutorial on Excel...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jun 9th, 2010, 04:11 AM
#5
Thread Starter
Addicted Member
Re: Save xls as html
I'm using '97 
I've managed to achieve what I wanted to do using SendKeys - not quite the silent batch process I was hoping for but at least it's [semi] automated
Another light-hearted post from Guru 
-
Jun 9th, 2010, 04:27 AM
#6
Re: Save xls as html
Not sure if the code that I gave will work with '97 but did you give it a try?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
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
|