How can I minimize Excel and new opened excel while my application is running?
I have written the following code, but the code fails.
If you wonder why I want to minimize Excel that is because my application fails if user clicks any excel cell!
Imports System.Management
Imports Microsoft.Office.Interop
Imports System.Runtime.InteropServices
Public Class Form1
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = True
Timer1.Interval = 100
Timer1.Start()
End Sub
End Class
I done a similar thing to my Word application to hide it when I'm using Word
object for spell checking. I'm very positive you can do that to excel also;
Excel._Application excel = new Excel.Application();
excel.Visible = false;
excel.ShowWindowsInTaskbar = false;
NOTE: The code is in C#.Net
setting Visible
to False
is wrong, it's not minimized.
Need to set Visible
to true
AND minimized
oXL.Visible = True
oXL.WindowState = Excel.XlWindowState.xlMinimized
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With