VB.NET - Communication between Excel Add-In and Workbook
Asked By Matthias Gräuler
09-Apr-09 08:12 AM

First, I'd like to say that I just started off working with VB.net and Visual Studio, so the solution to my problem may be really obvious to someone who has been working with it for a while. Also, my terminology may be a little mixed up as I'm using Visual Studio in another language. This website has already helped me a lot, but now I stumbled upon a problem that Google couldn't solve.
The goal of the application I'm writing is to have an add-in that reads from a database and puts a database table's content into an excel spreadsheet. The user may now alter any data in the spreadsheet and hit a seperate 'save'-button inside the add-in which will make the add-in write the changed rows back into the database. Writing and reading the cells isn't an issue.
After selecting a database and table in the add-in it creates a new workbook and writes into the cells.
My problem is the communication between the Excel Add-In and the workbook. All I need is to access the workbook_changed or worksheet_changed event to set a flag which rows have been changed or let the add-in know which cells (or at least rows) have been altered.
At the moment my project catalog only contains the addin. Should I add a excel-workbook project?
Thank you for reading all this, I really hope someone can help me.
Sort of solved it by myself
I found an event in the addin that fits my needs, but since I'm filling the excel-sheet cell by cell the event is called every time the add-in writes into it. I solved that problem by adding a boolean that is set to true every time the add-in is writing.
Private Sub Application_SheetChange(ByVal Sh As Object, ByVal Target As Microsoft.Office.Interop.Excel.Range) Handles Application.SheetChange
If Not filling Then
MsgBox("Yay!!!")
End If
End Sub

Learning VB.Net TUTORIAL .NET Framework Hi, 1. I am from Access 2003 VBA background, and wants to pick up VB.NET. 2. Is there a site for the step by step tutorial with light assignments for self-learning ? 3. Besides, any place to download its Visual Studio package for self learning ? 4. By the way, what is includes in Visual Studio 2008, 2005 ? Regards, Edison - - Message posted via DotNetMonster.com http: / / www.dotnetmonster.com / Uwe / Forums.aspx / dotnet-vb-net / 200909 / 1 VB.NET Discussions Visual Studio .NET (1) Visual Studio 2005 (1) Visual Studio
RS232C Communication in VB.NET 2003 .NET Framework Hi, I am trying to write a code which reads in the COM port). I found out that 'mscomm' can be used to solve this problem on VB.NET 2005. However, I was unable to find out any information about 'mscomm' from msdn that my caopy of VS.NET and any information on wheher 'mscomm' can be used in VB.NET 2003. Please let me know how to communicate through a RS232C port in VB.NET 2003. Thank you very much in advance! VB.NET Discussions VB.NET (1) Visual
Refer Can any body a good site for learning each and every aspects of vb.net theory HI Visual Basic .NET (VB.NET or VB .NET) is a version of Microsoft's Visual Basic that was designed, as part of the company's .NET product group, to make
Is VB.NET dead? .NET Framework Dear VB.NET Team, you did a wonderful job in making VB.NET a full fledged language, at least on the compiler side. When teaching students I always see that solving labs using VB.NET gives a faster result than C#. However the "distribution chain" to your customers is totally
Use of Mid Statement in VB.Net .NET Framework Hi All If anyone has the time, I think feedback on the following eg aba format. The beauty of the old VB6 Mid statement (which is available in VB.Net) is that it allows me to replace n chars at a specified position in a mfRecordType Mid(buffer, pointer, MyFields.mfTransactionType ) = "AB" pointer + = mfTransactionType 'etc etc There appears no native VB.Net equivalent to this method. The StringBuilder Class does not have this method either. It should as used above) for the Mid Statement in VS (any language)? Thanks for your time. VB.NET Discussions ASCIIEncoding (1) System.Runtime.CompilerServices (1) System.Text.StringBuilder (1) MyFields.mfTransactionType (1) MyFields