Msgbox VB.NET -Excel HOW??

P

Per Ove Steinsland

Hi group.
I'm using a .NET component from a 3.party supplier that my company uses.
I have a problem using msgboxes, they appear NOT in the suppliers app but in
my app.-in its own window ..

To give a good picture of my challange create a new vb.net -exe-windows
project. (Sub main startup)
And paste this code into Class1.vb, (add a reference to xl)

Public Class Class1

Private WithEvents XLAPP As Excel.Application

Private bolRunning As Boolean = True





Public Sub New()

XLAPP = New Excel.Application

XLAPP.Visible = True

While bolRunning = True

System.Threading.Thread.Sleep(1)

System.Windows.Forms.Application.DoEvents()

End While

End Sub

Private Sub XLAPP_SheetActivate(ByVal Sh As Object) Handles
XLAPP.SheetActivate

End Sub

Public Shared Sub Main()

Dim XLClass As Class1 = New Class1

End Sub

Private Sub XLAPP_NewWorkbook(ByVal Wb As Excel.Workbook) Handles
XLAPP.NewWorkbook

MsgBox("Im activated") 'This is the one I want to hook up in excel

End Sub

End Class

'**********'
When You start this project it starts excel.
When I create a new workbook the msgbox comes NOT in the EXCEL inviroment
but in it's own window.

I whant to "hook up" or attatch the mesagbox as a "child" to the excel
application.

Anyone
??

perove
 
S

Scott M.

Well, MsgBox() is a function in the VB language, not an object in the Excel
object model, so it makes sense that it is performing the way that it is.

You may have to resort to creating an Excel form that looks like a message
box and showing it when you need to.
 
P

Per Ove Steinsland

Yes it make sense.
¨
My idea was that there was some API to dispaly a messagebox and "hook it up"
in my app window.
My challange is that this is not a xl but another 3.party app that gives me
no potion to show and or create a form..

perove
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top