473,668 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# Interaction.App Activate Procedure

I want to activate an application (Excel) in code. If I reference
microsoft.visua lbasic, I could use:

Interaction.App Activate("Micro soft Excel");

But I wold rather use a native C# approach. I know that Interaction.Msg Box
has a native analog: MessageBox.Show .

Is there one for AppActivate?
Aug 21 '07 #1
2 8918
There is no managed equivalent other than the VB implementation. It
ends up calling SetForegroundWi ndow, but it does a great deal of other setup
as well (getting the window handle, checking to see if it is enabled, etc,
etc), so you might want to use the class in VB.

Note, the Interaction class in the Microsoft.Visua lBasic namespace IS
managed code, and is no less native to .NET than any classes you might use
in the System namespace, or anything else. C# is the language, the glue
that you use for calling existing managed code constructs.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"mr peanut" <mr******@discu ssions.microsof t.comwrote in message
news:F9******** *************** ***********@mic rosoft.com...
>I want to activate an application (Excel) in code. If I reference
microsoft.visua lbasic, I could use:

Interaction.App Activate("Micro soft Excel");

But I wold rather use a native C# approach. I know that
Interaction.Msg Box
has a native analog: MessageBox.Show .

Is there one for AppActivate?

Aug 22 '07 #2
I see using this approach fails when Excel is minimized.

"Nicholas Paldino [.NET/C# MVP]" wrote:
There is no managed equivalent other than the VB implementation. It
ends up calling SetForegroundWi ndow, but it does a great deal of other setup
as well (getting the window handle, checking to see if it is enabled, etc,
etc), so you might want to use the class in VB.

Note, the Interaction class in the Microsoft.Visua lBasic namespace IS
managed code, and is no less native to .NET than any classes you might use
in the System namespace, or anything else. C# is the language, the glue
that you use for calling existing managed code constructs.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"mr peanut" <mr******@discu ssions.microsof t.comwrote in message
news:F9******** *************** ***********@mic rosoft.com...
I want to activate an application (Excel) in code. If I reference
microsoft.visua lbasic, I could use:

Interaction.App Activate("Micro soft Excel");

But I wold rather use a native C# approach. I know that
Interaction.Msg Box
has a native analog: MessageBox.Show .

Is there one for AppActivate?


Aug 23 '07 #3

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

Similar topics

7
19277
by: DottingTheNet | last post by:
hi!! just wanna know how to accept user input?? if i prompt a question "Are u happy today?(Y/N)" how do i receive user's answer? thnx
1
4072
by: Alex Cicco | last post by:
Hi, I am new to SQL. Please bear with me and allow me to ask a dumb question. I am debugging a stored procedure (written in Trans-SQL), and I found that the SQL analyzer that I use doesn't have a debugger. All I can do it is execute a block of code and see what is going on in an interaction seesion of the SQL analyzer. I would need to declare some variable to hold values of the previous query in the interactive
3
4120
by: Aaron Queenan | last post by:
I have a form which performs some asynchronous code. I want to display a wait cursor when it starts, and hide the wait cursor when it has completed. This part works fairly well, using: this.TopLevelControl.Cursor = System.Windows.Forms.Cursors.WaitCursor; I also want to prevent user interaction with the controls on my form while the wait cursor is displayed, so that use events (except resize and cancel) are blocked. What is the...
1
8851
by: Alex | last post by:
Can I find a Function like AppActivate of VB.net in C#?
1
1602
by: Lars Gaarde | last post by:
I need to activate another application, after clicking in a right click menu/context menu in my application. Problem is that the other application doesn't get activated and brought to the front as expected. All it does is flash it's "icon" in the taskbar. I then have to click on the flashing icon, to actually activate the other application. If i call AppActivate directly from a commandbutton it works just
0
1531
by: Austin | last post by:
Hello: I have written a very simple vb program (using the new .net interface). I have a website to which I must upload many files. The filenames are incremented in such a way that a simple for loop is able to generate the filenames.
5
10273
by: diSangro | last post by:
Hello Community, I have a question : why , if I try to use AppActivate applied to cmd.exe it doesn't work? My purpose is to run a VB script from Excel which opens a Telnet or an ftp session, then it gives commands using SendKeys method. I am using the following code: '--------------------------------------------------------------- Dim p_ID Dim FullPath As String
0
2138
by: Omar Abid | last post by:
Reason of this project: The Microsoft.VisualBasic.Interaction class exposes many useful commands and methods that were available in Visual Basic like AppActivate, Beep, Callbyname... This tutorial shows how to work with some of them. Project details: 1- From VB 6.0 to VB .net 2.0 2- Useful interaction commands 3- Samples of interaction commands
3
3944
by: mmm | last post by:
I am looking for advice on Python Editors and IDEs I have read other posts and threads on the subject and my two questions at this time are mainly about the IDLE-like F5-run facilities. While I am fairly happy using IDLE, the debugger is unintuitive to me and I wanted a project manager and a better variable/ class browser and also the potential to edit/run other languages such as R and Tex/Latex. Windows and LINUX compatibility is...
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8799
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8658
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.