473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Msgbox VB.NET -Excel HOW??

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


Nov 21 '05 #1
2 4802
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.
"Per Ove Steinsland" <pe****@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
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

Nov 21 '05 #2
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
"Scott M." <s-***@nospam.nospam> wrote in message
news:OC*************@TK2MSFTNGP12.phx.gbl...
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.
"Per Ove Steinsland" <pe****@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
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


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Peter Bassett | last post by:
In my ASP script I call Javascript for a msgbox after the user has submitted the form of their resume information. I saw this example as a way to get a msgbox onto the client from ASP since server...
3
by: JT | last post by:
im trying to use the MsgBox function in the following to display an ASP MsgBox containing text retrieved from the db into a recordset <% set rsMessages= myRecordset msg_text =...
2
by: js | last post by:
Hi all, I currently encounter a problem and it is urgent to me. After calling the MsgBox.Show(), the message box is shown with non-modal mode, what is the possible reason??? This only happen...
4
by: Lakrom | last post by:
Hi to all, how to put msgbox in this asp page, this send me a message Denied permission: 'MsgBox' <% Set Conn=server.createobject("ADODB.connection") Conn.open application("StrConRuta") set rs =...
6
by: Lapchien | last post by:
In this bit of code provided so helpfully by Nath: Private Sub Command118_Click() Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.openrecordset("IMPORT")
8
by: deko | last post by:
Can I close a MsgBox with VBA Code? Something like: If IsOpen (MsgBox, "Title") Then Close(MsgBox, "Title") Run some code Else Run other code End If Can this be done in VBA? Do I need to...
2
by: Radith Silva | last post by:
I need to use the MsgBox function like I used to in VB 6.0 So all i do is: MsgBox ("Please provide Input") BUT IN .NET: The error reads "msgbox is a namespace"
4
by: James | last post by:
What does this mean? 'To specify more than the first argument, you must use the MsgBox function in an expression' I'd love to see an example. Thanks!
9
by: Ivan Jericevich | last post by:
In my code below at the line 'response' a blip sound is heard and the program exits the sub -- No MsgBox is displayed. What am I doing wrong? If nonNumberEntered = True Then msg = "Enter...
2
by: perkykoala | last post by:
I apologize in advance for being REALLY detailed/verbose. It's the result of staring/tweaking code for too long. Using VB 2005: I need to design a multiple choice test (unfortunately, I can't...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.