<p>We are automating Excel using VB.Net, and trying to place multiple lines of text on an Excel worksheet that we can set to not print. Between these we would have printable reports.
We can do this if we add textbox objects, and set the print object setting to false. (If you have another way, please direct me)</p>

<p>The code to add a textbox is:</p>

<pre><code>ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 145.5, 227.25, 304.5, 21#)
</code></pre>

<p>but the positioning is in points. We need a way to place it over a specific cell, and size it with the cell. How can we find out where to put it when we just know which cell to put it over?</p>

[{'answer_id': 67740, 'author': 'dreamlax', 'author_id': 10320, 'author_profile': 'https://Stackoverflow.com/users/10320', 'pm_score': 4, 'selected': True, 'text': '<p>If you have the cell name or position, you can do:</p>\n\n<pre><code>With ActiveSheet\n  .Shapes.AddTextbox msoTextOrientationHorizontal, .Cells(3,2).Left, .Cells(3,2).Top, .Cells(3,2).Width, .Cells(3,2).Height\nEnd With\n</code></pre>\n\n<p>This will add a textbox over cell B3. When B3 is resized, the textbox is also.</p>\n'}, {'answer_id': 76279, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>When you copy &amp; paste a textbox, Excel will place the new textbox over whichever cell is currently selected.  So you can achieve this very easily by simply using the VBA copy &amp; paste commands.  This can be particularly useful if you are going to be using a lot of very similar textboxes, as you are effectively creating a textbox template.</p>\n'}]
['https://Stackoverflow.com/questions/66934', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']