Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Hide Window In Excel W/ VBA?

I'm trying to open another workbook to reference data.

Workbooks.Open Filename:="C:KPKUVGNInside SalesFBO Reps.xls"
Windows("FBO Reps.xls").Activate
Range(Selection, Selection.End(xlDown)).Select

However, when the parent worksheet (test.xls) opens (FBO Reps.xls) from visual basic, the macro stops.

It doesn't give any errors or stop codes. It just stops at line 1.
Workbooks.Open Filename:="C:KPKUVGNInside SalesFBO Reps.xls"

Any help would be greatly appreciated.


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Hide Parent Window On Display Child Window.
I have developed small cutom application.My clicking menu item on the parent window, child window displays.At the same time I want to dismiss(hide) the parent window.Again if I close the child window the parent window should display.

Any help please in VB.

Hide A Window
how can i hide an window

Hide Window
Is it possible to hide a form when the user takes the mouse away from it?

Hide Window
is there a way in vb to hide the window and display only it's contants? (image, frame, buttons)?
for example not to see the title bar (caption bar of windows)

Hide Window
How can I make it so there is no window for the program. (the programs between the start and system tray), also so it isn't in the system tray?

Hide Window
Hey,guys wonderin if any one can show me how to hide a window what has specfic text in it say the caption is "Bla bla lol 2005 pro" and in the program if i have it to hide all windows what are open with "bla" in how could i hide it,i want to hide the windows not close thanks

Hide DOS Window
Is it possible for me to hide a DOS window? A certian switch maybe? .. The dos program cannot actually be closed, it can only be hidden. ...Any ideas would be greatly appreciated.

Hide [x] Of A Window
how to hide (or disable) the [x] (closebutton) of a window?

think with the thel of sendmessage, but i don't know the message to send along to the window.

thanx in advance

Hide Window
How can i hide the dial-up connection window?

I used the following code.

Private Function HOConnect() As Boolean
Dim mlConnectionNumber As Long
Dim lngResult As Long
mlConnectionNumber = 0&
If Online Then
HOConnect = True
txtStatus = "Connecting ..."
lngResult = InternetDial(Me.hwnd, dun, INTERNET_AUTODIAL_FORCE_UNATTENDED, mlConnectionNumber, 0&)
If lngResult = ERROR_SUCCESS Then
HOConnect = True
txtStatus = "On-Line"
txtStatus = "Off-Line"
End If
End If
End Function

How can i hide the window in order to prevent the user from cancelling the command?

Thank you!

Hide Window
    how I can hide another windows...I have a inactive window and
    I want to just hide the window not it's process....

Is There Any Way To Hide The Upper Bar Of A Window?
Visual basic verion:6
I would like to find a method (or something) to hide the upper bar of a window. For those who don't understand what I mean with the term "upper bar" I mean the (by default blue) bar that contains the minimize,maximize and exit buttons. (It is the one that you catch in order to move a window manually).

Hide The Window Format...
Somebody knows if i can hide the window format from a form like to initialize a program with a image without the title bar or to show a message form without this format? I don't know if it's possible... Thanks

How Can You Hide A Window Based On Its Exe Name?
Anyone know?
I want to hide all windows that contain 'notepad.exe' for example, how can I do this?

Hide Window Clock
Dear all,
How can I place my clock program to overlap the windows clock control?.

Hide/Show Window
Hey,how can i hide/show window by press pressin alt + 1 to show and alt + 2 to hide thanks

How would I hide/show another processes' window, similar to SW_HIDE and SW_SHOW (I think).


I want to make a program that has 2 command buttons: Hide Wordpad and Show Wordpad. Hide Wordpad hides wordpad completly, only to be seen in task
manager. Show Wordpad makes wordpad come back and appear in taskbar.

Hide Minimized Window
I downloaded some sample code for an MDI form taskbar that immitates the Windows taskbar, but when you minimize a form, it still minimizes into a little blue box. Any APIs I can use to hide it when it minimizes?

Hide/Show Window
I like to use API or send message to window and hide it. By hide i mean hide it from the screen and system-tray and TaskBar. And after hide it i like to know how to reshow it.

Thank you,

Help Me Hide The Console (dos)window
I am writing small programs to clean up text files for import into ms access. I have been able to easily implement the programs but The issue is that when these programs run they bring up a dos window showing what it is doing. I would like to know if there is a way to supress the popup of the console window or make it run in the background some way

hope someone can help


Minimize Or Hide This DOS Window
when i run a batch file it always pop up a DOS window on my windows 2000 computer.
how can i Minimize or hide this DOS window?

Hide A Window Before It Is Created?
Does anyone know of a method to hide a window before it appears or before it is sent a window message such as WM_SHOW.

I am thinking this is going to require some message stream monitoring (hooking) and I am wondering if someone can point me in the right direction of a specific API function to use or an example that you can find on mr. google.

I have looked around many places but have never came upon an exact solution to this problem.

If anyone is curious to why I am trying to do this, basically is it to make better functions that help manipulate windows. As many of you know, sometimes you have to take the messy rounte, and perform functions by use of interaction of Sending various messages to windows: Ex: Jumping to a registry key. And other times if the task is performed in the background without taking away focus from the user, it is much cleaner and easier to use. With this said I am trying to bring up a window, and hide it before it takes focus / displays (or blinks depending on how fast you hide it).
Of course I could just use a timer to monitor for the window creation, but the window still blinks (kinda icky looking when you see a window flash and then go.)
So my goal is to try and hook a processes message stream, or the entire message stream (if possible without process injection crap) and monitor for my window I want to manipulation during it creation.

Thanks for your help =].

Hide Window In Taskbar
how can i hide the application window which is to be displayed in system taskbar for my MDI form

please solve my problem

thank u

How To Hide A Console Window Thru VB
Hi all,
I am getting a problem of a console window.This window opened by some other application.Still,i could get the window handle and process id.I have tried thru showwindow options.But,i could not solve the problem.Can anyone help me,how to hide the console window.

Kind Ragards

Hide Batch Command Window In VB
i'm trying to hide a batch window that i have launched in VB. all i want to do is use a CommandButton and not have the DOS Prompt pop-up in the background. is there any way to do this?

Delete/Hide Part Of A Window?
what message do i send to a hWnd to effectively hide a part of the window?

example: the rotating banner ad in Yahoo Messenger's remote webcam window..... i can subclass the window and get the hwnd of the box, but what do i do to actually hide/remove it?

ive tried using WM_Destroy and WM_DeleteItem even though i dont really know what they are for obviously they didnt work...

any help?

Hide/Show Window By Caption
How would i hide / show a window by a caption via API?

Cannot Hide DB Window With Custom Icon
In Access, Tools->Start... I uncheck the "Show Database Window" checkbox to hide the database window when the database opens.

When I enter an icon to be used for the program, the hide DB window utility cease to work on Windows 2000, but not on Windows XP, e.g. the DB window is shown when opening the database on a Window 2000 system.

Any suggestions on how to solve this?

How To Hide Window That Running Applications?
first, i manage to burn CD using Visual Basic but the window of CD writing wizard is on top of my form..if u could tell me how to hide the window even it's running the application..I would much appreciated..

Hide A Form Window With A Windows Handle
I wrote a batch printer program, but I ran into a problem. I want to hide the little print dialog box that counts the pages, when one hits print, in order to have a total background printing. I found some code online that allows me to get a windows handle on that print window, is there a way to now hide it with VB6 or with an API Function?

Thank You

Hide Execl Window With Form Ontop
I have an instruction page which sits on top of a third party programme and walk the user through the process I want them to carry out then jump back to Excel.

A present I have made the form topmost and not Enabled with Excel window sized smaller and behind the form so excel is hidden from the user.

This meant even if the user selects the excel form the main Excel window would not obstruct the third party programme from users view.

How ever I have been requested to make the Form user moveable

This mean I must find a way to hide the main excel window and prevent it from jumping in front of the third party programme even if the Form is selected moved.

I have tried SWP_Hidewindow instead of SWP_showwindow

But I cant seem to get Excel to hide.

Below is my current code.

Any help much appreciated


Sub ResizeExecl(state4)

Ret3 = "Microsoft Excel - " & ThisWorkbook.Name
'Search of the window
WinWnd4 = FindWindow(vbNullString, Ret3)

If state4 = xlOn Then
SetWindowPos WinWnd4, HWND_NOTOPMOST, 270, 74, 120, 30, _
End If

If state4 = xlOff Then
ShowWindow WinWnd4, WM_ACTIVATE
ShowWindow WinWnd4, SW_SHOWMAX
End If

End Sub

Sub LoadFormAndDisplay()

'Ask for a Window title
WinWnd2 = FindWindow("ThunderDFrame", InstructionForm.Caption)
'Show the window
ShowWindow WinWnd2, SW_SHOWNORMAL
'Set window position and keep on top
SetWindowPos WinWnd2, HWND_TOPMOST, 270, 74, 0, 0, SWP_NOACTIVATE Or _
'prevent movement
InstructionForm.Enabled = False
'load instructions onto form

End Sub

RESOLVED: How Can I Hide The Main Window When It First Loads?
I have a main Form1 and when the form first loads there is a bunch of initialization stuff which occurs. Instead of having the main Form1 ecome visible upon loading, I would like it to be hidden until all initializations have completed.

Currently, when the form loads I immediately do a "Form1.Hide" and then after initialization has completed I performs "Form1.Show". However, when the application is started, the outline of the main Form1 window flickers into view and then very quickly disappears due to the "Hide" method call.

Question is, how can I get rid of the "flicker" which occurs before the Form1 is loaded?

PS: I tried immediately setting the Left property of the Form1 window in the Load method to be somewhere off the screen, but I still see the flicker until this occurs. I also set the Visible property of the main Form1 during design time to be FALSE, but this did not work since I could not seem to set the visible property back to TRUE during runtime at the correct time. The main Form1 thus never became visible.

Edited by - uncletr on 3/11/2007 8:31:39 PM

Hide Dos Window -launch And Wait For Finished
I am using code below to launch my application. If lauched application is DOS based then a dos window appears. What i have to do for hide dos window.

cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type

hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadID As Long
End Type

Private Declare Function WaitForSingleObject Lib _
"kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds _
As Long) As Long

Declare Function CreateProcessA Lib "kernel32" _
(ByVal lpApplicationName As Long, ByVal lpCommandLine As _
String, ByVal lpProcessAttributes As Long, ByVal _
lpThreadAttributes As Long, ByVal bInheritHandles As Long, _
ByVal dwCreationFlags As Long, ByVal lpEnvironment As Long, _
ByVal lpCurrentDirectory As Long, lpStartupInfo As _
As Long

Declare Function CloseHandle Lib "kernel32" (ByVal hObject _
As Long) As Long

Private Const INFINITE = -1&

Public Sub ExecCmd(cmdline$)
Dim ret&

'Initialize the STARTUPINFO structure:
start.cb = Len(start)

'Start the shelled application:
ret& = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)

'Wait for the shelled application to finish:
ret& = WaitForSingleObject(proc.hProcess, INFINITE)
ret& = CloseHandle(proc.hProcess)
MsgBox "finished!"
End Sub

Program Launches Batch File, Can I Hide DOS Window?
I have a program that builds and then launches a batch file using Shell. This obviously opens up a DOS session and executes commands in that batch file which the user can see if he/she decides to switch to that window. Is there a way I can make the DOS session invisible? Thanks.

Hide Window In Applications Tab Of Windows Task Manager
How do I hide my VB program from the Applications tab in the Windows Task Manager?

How Can You Hide An 3rd Party Window From The Taskbar? (*Resolved*) - $20 Paypal
Please guys im desperate here.. i really need to know how to do this and there seems to be no resources on the net or anything.

Basically i want to create an internet explorer object, and hide it from the taskbar - but keep it active. if ie is hidden (visible=false) it doesnt function correctly. i cant use the webbrowser because the webbrowser has no toolbars. So, i have 3 ways of doing this. 1) Remove the application from the taskbar (but keep it active). 2) Run the application within my form so it doesnt add itself to the taskbar 3) Be able to add the ie toolbars to a webbrowser on my form. Anyone that can answer any of these will receive $20 from me thru paypal.. ive been looking for an answer for a week, and boss is getting very mad...

The app im trying to hide from the taskbar does not function if it is inactivated..

VB Code:
Private Declare Function ShowWindow _ Lib "user32" ( _ ByVal hwnd As Long, _ ByVal nCmdShow As Long) As Long Private Const SW_HIDE = 0
If i use SW_HIDE, the app is removed from the taskbar but it is inactivated too, and it wont work

i need a way to just remove a app from the taskbar (i have its hwnd).

Maybe it is possible to use SW_HIDE first to remove it from the taskbar, but somehow activate the program again by showing it? Ive tried using sw_hide then using IE.Visible = True, but it adds itself to the taskbar again

I just want to remove the taskbar item, but have the window remain visible

please help me..

is it possible to use SW_HIDE to hide the app from the taskbar and inactivate it, then activate it again somehow with api?

is it possible to load an app within a vb app? (im trying to hide an internet explorer window. I cannot use the webbrowser control because the webbrowser has no toolbars like the google toolbar)

is it possible to add a toolbar to a webbrowser?


How To Hide Group Of Excel Rows From Vb 6.0 While Generating Excel Report ???
hello every one,

i want to hide particular number of excel rows while i am generating excel report from vb 6.0

it is just like what we do in excel --> data(menu)-->group and outline

here in this sub menu we can group particular number of rows/ columns
by selecting rows/columns and then clicking group sub menu
please help me in this

Window XP Error 's Window Pop Out While Opening Excel File
I had created a button to open an excel sheet with the following code (also added the excel references):

Private Sub Command1_Click()
Dim AppExcel As Object
Dim AppWorksheet As Object
Dim AppWorkbook As Object

Set AppExcel = CreateObject("Excel.Application")
Set AppWorkbook = AppExcel.Workbooks.Open("C:ook1.xls")

AppWorkbook.Application.Visible = True

End Sub

I then make the program into EXE and run it on my PC (windowXP with microsoftXP offices) with no problem. The excel file opened.

Later I copy the EXE file into my office's PC (windowXP with microsoft office 2003) and run it, EXE file ran. But when I click on the button to open excel file, the window xp error reporting window pop out then the EXE file was closed. I checked the Windows Task Manager and found that the excel software was loaded but not visible.

Wondering what's wrong?

Hide Excel File From Excel
Hi. I'm opening an excel file from vb and I'm making changes to it. While the excel file is opened, if the user double-clicks on some excel file in windows, and excel starts up, if you go to "Windows" in excel, you can actually see the excel file that i've opened with vb. How can i hide the file that I've opened from vb, from excel?

I don't want the user editing it in excel, while I'm doing updates to it from vb. I know that it's got probably something to do with the way workbooks are open, but there are so many arguments and i don't think that any of them will help me.


How To Hide A Row In Excel
Hi how do i hide a row in excel using VB. Lets say for example I need to hide row # 26. How can i do this. pls help

How Do You Hide Those Formulas In Excel?
Hello experts

I m in the midst of creating an excel worksheets for colleagues to key in some values (numeric) meant for a special project. Since this project is still in its infancy, I would prefer to hide away the formulas first.

So anyone knows how to make those formulas disappear while still enable us to perform the calculations.

Any suggestions or ideas are highly appreciated

Thank you in advance.


Hide Excel Sheets
I have an Excel Spreadsheet with 8 different Sheets on it (call them Sheet1 through Sheet8).

The spreadsheet is populated on a SQL query run from my VB program, which in turn, populates one of the 8 sheets (depending on the query)

This all works fine, but the tabs for all eight sheets are visible when the spreadsheet appears, and people are confused with respect to which Sheet tab to click to get their results. So, my boss wants me to break the spreadsheet down into 8 separate and distinct spreadsheets, with only a Sheet1 on each. This seems like a waste. I'd like to be able to keep everything on one spreadsheet, but hide the tabs for the seven spreadsheets that are not currently being used.

How do I display just the one sheet that has been populated by my query?

Hide Excel When Updating?
I have an application that opens up an excel sheet and updates it with values.

I'm using the goto method. Is it possible to update the sheet and not show it?

btw can anyone explain these few lines of codes? thanks.


obj.Application.Visible = True
obj.Windows(1).Visible = True

obj.Application.ScreenUpdating = False

' My updating starts here.
MyName = "RPQC1"
MyValue = Module1.CRPQ1
obj.Application.ActiveCell.FormulaR1C1 = MyValue

How To Display A Form But Hide Excel?
I have an Excel macro which performs calculations which take approx 10 minutes. I have a progress meter contained in a form which tells the user how long the process is taking and when they can expect it to finish. I would like to hide Excel from the user but allow them to see the form. I can only find a method to show them both at the same time. When the macro is called via a button on the spreadsheet, I use Application.WindowState = xlMinimized to hide the form, and then I say frmProgress.Show to display the progress bar. But the application minimises, taking the progress bar with it. I thought there might be an Always-On-Top property associated with the form, but not that I can find. It would be ideal to keep the progress bar in the corner of the monitor screen while the user works on something else.

Any suggestions? I believe sub-classing Excel is a potential solution, but its too complex for my liking.

Hide Excel Whilst In UserForm
Hi, am I able to hide excel whilst in a userform? And if at all possible if the user tries to open another spreadsheet it opens in a new instance of excel?

I am using Excel 97 by the way...

Cheers muchos!

How Can I Get Hide A Formula Made In Vb6.0 To Excel
Hello Guys
Here i'm again asking simple questions but not easy to a new programmer like me. I need to hide a formula or a cell content in excel from vb6.0. I made all ok but my excel file that i'm making through an ole connection from vb6 always shows the formulas that i'm using. What i need is just hide my formulas but not losing its contents. And other questions How can i put in a disabled state a scrool bar of window that always appears below my form in run time?. I don't want to hide it, just disable it to people doesn't open up my excel sheet when it's running.

Thanks in advance

Objects - How To Hide/unhide These In Excel App?
Should be simple , but how to hide/unhide objects (forms) in Excel and make them reappear in the same location?


Code To Hide Rows In Excel
I'm looking to write code which will select a particular column (A0) and hide all rows with a zero cell in this column. Could anyone help with this please?

Code To Hide Rows In Excel

I'm looking to write a procedure using vb in Excel to hide all rows where the content of column B is "DELETED". Could anyone help with this please?

Could the rowref property be used to solve this and if so could you give an example? Or could you help me with some code to move to the row below the current row in the spreadsheet, for example (in words):

GoTo Next Row
If cell in column B.value = "DELETED" Then
hide row
GoTo RowBelowProcedure
Loop Until column B.value = ""


Hide And Show Picture In Excel
Does anyone know how to hide or show a picture in excel depending whats in a certain cell? I am absolutely inexperienced with working with excel marcos btw. Please help thanks.

Copyright 2005-08, All rights reserved