A colleague is automating the creation of an email report in MS Outlook 2013 from MS Excel 2013 using this code from Ron de Bruin.
The code ignores charts so what we have done is merge all the cells behind where a charts sits on the spreadsheet and then once we have the email in Outlook (we use the .display
property rather than .send
so we can check and edit the mail before sending it) we can just regular copy and paste the charts into these merged cell blocks and everything looks great.
However, when we use the exact same spreadsheet (it's on a network drive) on a different computer, the mail in Outlook has different row heights. This means that the merged cell block is now taller and when we paste the charts in they no longer fill the space.
Does anyone know of a Windows / Outlook / Excel setting that might be causing this? We're running Windows 8 and Office 2013 Home and Business.
Here are screenshots of a sample from both computers:
So the row height on the second computer is larger and this cause an area of white space under the chart (which is pasted into a large area of merged cells).
We also looked at the HTML on each computer and there is indeed a difference. Here is a small sample from each:
<body>
<!--[if !excel]> <![endif]-->
<!--The following information was generated by Microsoft Excel's Publish as Web
Page wizard.-->
<!--If the same item is republished from Excel, all information between the DIV
tags will be replaced.-->
<!----------------------------->
<!--START OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD -->
<!----------------------------->
<div id="Sheet1_25510" align=left x:publishsource="Excel">
<table border=0 cellpadding=0 cellspacing=0 width=807 style='border-collapse:
collapse;table-layout:fixed;width:605pt'>
<col width=56 span=2 style='width:42pt'>
<col width=135 style='mso-width-source:userset;mso-width-alt:5760;width:101pt'>
<col width=56 span=10 style='width:42pt'>
<tr height=16 style='height:12.0pt'>
<td height=16 class=xl6325510 width=56 style='height:12.0pt;width:42pt'> </td>
<td class=xl6325510 width=56 style='border-left:none;width:42pt'> </td>
<td class=xl6325510 width=135 style='border-left:none;width:101pt'> </td>
<td class=xl6325510 width=56 style='border-left:none;width:42pt'> </td>
...
And
<body>
<!--[if !excel]> <![endif]-->
<!--The following information was generated by Microsoft Excel's Publish as Web
Page wizard.-->
<!--If the same item is republished from Excel, all information between the DIV
tags will be replaced.-->
<!----------------------------->
<!--START OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD -->
<!----------------------------->
<div id="Sheet1_17217" align=left x:publishsource="Excel">
<table border=0 cellpadding=0 cellspacing=0 width=903 style='border-collapse:
collapse;table-layout:fixed;width:677pt'>
<col width=64 span=2 style='width:48pt'>
<col width=135 style='mso-width-source:userset;mso-width-alt:4937;width:101pt'>
<col width=64 span=10 style='width:48pt'>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl6317217 width=64 style='height:15.0pt;width:48pt'> </td>
<td class=xl6317217 width=64 style='border-left:none;width:48pt'> </td>
<td class=xl6317217 width=135 style='border-left:none;width:101pt'> </td>
<td class=xl6317217 width=64 style='border-left:none;width:48pt'> </td>
<td class=xl6317217 width=64 style='border-left:none;width:48pt'> </td>
...
The row height in the first HTML is 16
(i.e., <tr height=16...
) and in the second it is 20
!