I can throw a button on a Worksheet that opens a WinForm. But I can't
figure out to the put a Button on a WinForm to a worksheet to the
workbook. I keep getting an error:
Object reference not set to an instance of an object.
What is the correct way to get a reference back to the ThisWorkbook
object? without it somehow going out of scope?
I even tried passing the ThisWorkbook into the constructor of the Form
object... and still get the error.
Thanks,
Kelly Greer
kellygreer1@yahoo.com
change nospam to yahoo
Hi Kellygreer1,
> I can throw a button on a Worksheet that opens a WinForm. But I can't
> figure out to the put a Button on a WinForm to a worksheet to the
[quoted text clipped - 7 lines]
> I even tried passing the ThisWorkbook into the constructor of the Form
> object... and still get the error.
I was just going to suggest this. Whenever I've done it, it works. Could
you show us the code behind the button on the workbook, as well as the
WinForms constructor and the code behind the button on the WinForm?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)