How to start a VBA with worksheet minimize.
How to start a VBA with worksheet minimize.
(OP)
Hi, VBA experts,
In order to beutify my prog's interface, i would like to open the Excel file(active VBA) with the worksheet in the minimized background, i.e. only the Userform or a Dialog window, from the right beginning on!
as if it was a standalone VB or VC main interface,(nothing to do with the Excel.sheets..
Is that possible?
THX!
In order to beutify my prog's interface, i would like to open the Excel file(active VBA) with the worksheet in the minimized background, i.e. only the Userform or a Dialog window, from the right beginning on!
as if it was a standalone VB or VC main interface,(nothing to do with the Excel.sheets..
THX!





RE: How to start a VBA with worksheet minimize.
Sub OpenExcelSample()
Dim xlApp As Excel.Application
Dim wb As Workbook, ws As Worksheet
'Start Excel - Open Requested File
Set xlApp = New Excel.Application
'Minimize(xlMinimized ) or Maximize(xlMaximized)
'the Application Window
xlApp.WindowState = xlMinimized
'Make the Application Visible
'If False, it will not be shown on the Windows Toolbar
' Not Recommended because on failure, you can only
' access it through Explorer
xlApp.Visible = True
'Open the Excel File READ-ONLY
Set wb = xlApp.Workbooks.Open("C:\YourFile.xls", True, True)
'Open the Excel File READ-WRITE
'Set wb = xlApp.Workbooks.Open("C:\YourFile.xls", True, False)
'Select the Desired Sheet
Set ws = wb.Sheets("Sheet1")
'AND SO ON...
'Clear Objects
Set ws = Nothing
Set wb = Nothing
Set xlApp = Nothing
End Sub
Hope this helps...
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: How to start a VBA with worksheet minimize.
but what i really want is within the Excel and alone with the VBA.
e.g:
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Me.Worksheets.Visible = False
'or, Excel.WindowState = xlMinimized
myprog_form.Show
End Sub
but Excel refuse to it
RE: How to start a VBA with worksheet minimize.
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: How to start a VBA with worksheet minimize.
Private Sub CommandButton1_Click()
Call test
End Sub
Sub test()
Application.WindowState = xlMinimized
AppActivate "Microsoft Excel"
UserForm1t.Show
End Sub
The UserForm1 will be shown with the Excel window minimized.
Without "AppActivate" the icon of Excel on the taskbar will blinck and only after clicking it will activate the form.
I hope this is what you want ?!?!
RE: How to start a VBA with worksheet minimize.
Application.WindowState = xlMinimized
AppActivate "Microsoft Excel"
UserForm1.Showtext
End Sub
Error "400": the userform is already there and cannot be linked.?
RE: How to start a VBA with worksheet minimize.
Application.WindowState = xlMinimized
AppActivate "Microsoft Excel"
UserForm1.Show
End Sub