Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / VS Tools for Office / May 2008

Tip: Looking for answers? Try searching our database.

VSTO Excel / WinForms question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kellygreer1 - 30 May 2008 02:47 GMT
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
Cindy M. - 31 May 2008 10:07 GMT
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 :-)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.