Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2007 insert HTML with images

Hi2all!

I want add to active Worksheet content of 1 HTML file, which consist of
paragraphs, tables and images. I use the following code to do this:

public void InsertHTML()
{
object connection = @"URL;C:\html\test_html.html";
Range curRange = (Range)this.Application.Selection;
Worksheet curSheet = (Worksheet)this.Application.ActiveSheet;
QueryTable tblQuery = curSheet.QueryTables.Add(connection, curRange, missing);
tblQuery.BackgroundQuery = true;
tblQuery.TablesOnlyFromHTML = false;
tblQuery.Refresh(false);
tblQuery.SaveData = true;
tblQuery.Delete();
}

And I have 2 problems:
1) no images from source 'test_html.html' file is inserted into worksheet;
2) no table column width is derived from source file

But when I press Ctrl+O from Excel and open this HTML file, all images and
table styles import correctly! How I can get the same in my VSTO add-in?
Reply
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
Excel 2007 and inserted images ZipCurs Excel Programming 5 March 20th 08 06:05 PM
imported images in Excel 2007 colby_52 Excel Discussion (Misc queries) 0 March 10th 07 07:58 AM
print images in excel 2007 ddd444 Excel Discussion (Misc queries) 0 July 14th 06 10:03 PM
Excel replaced HTML Project but Images are lost [email protected] Excel Programming 0 July 13th 05 03:01 PM
VBA code to insert images in excel sheet Riya Excel Programming 2 October 29th 03 12:22 PM


All times are GMT +1. The time now is 10:33 PM.

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"