473,409 Members | 2,057 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,409 software developers and data experts.

Find Open Windows and Close using VBA

Hi

I am running an Access Database, and need to find - and close - any
open instances of MS Excel using VBA Coding

Does anybody have any sample code

I know this is possible using VB and GetWindow, but on this occasion,
I need to use VBA

Help please

Thanks

Gary
Nov 13 '05 #1
4 10935
Gary Cobden wrote:
Hi

I am running an Access Database, and need to find - and close - any
open instances of MS Excel using VBA Coding

Does anybody have any sample code

I know this is possible using VB and GetWindow, but on this occasion,
I need to use VBA

Help please

Thanks

Gary


Goto http://www.mvps.org/access/ and check out the API calls there. I
used/modified one of the APIs to get the class/caption of the windows.
I modified it to pass back a string of the class/caption name and parsed
the string to separate the two. Next, there is an API to close an app
based on class/caption.
Nov 13 '05 #2
Great; the previous suggestion - check out http://www.mvps.org/access/
- was very helpful and enabled me to solve the closure of any
occurrances of Excel running with Visible = True

However, I also have an occurrance of Excel running with Visible =
False, and am having difficulty getting this to close.

Any ideas please

Thanks

Gary
Nov 13 '05 #3
Great; this was very helpful and enabled me to solve the closure of any
occurrances of Excel running with Visible = True

However, I also have an occurrance of Excel running with Visible =
False, and am having difficulty getting this to close.

Any ideas please

Thanks

Gary


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #4
Gary Cobden wrote:
Great; the previous suggestion - check out http://www.mvps.org/access/
- was very helpful and enabled me to solve the closure of any
occurrances of Excel running with Visible = True

However, I also have an occurrance of Excel running with Visible =
False, and am having difficulty getting this to close.

Any ideas please

Thanks

Gary


No I don't. I'm not sure how to set up Excel to be opened but invisible
so I'd be the wrong person to ask. You might want to post a new message
with a new subject line and see if someone answers the part of closeing
with Excel visible = False. You might also want to let the folks know
how it is opened invisibly in the new message. The reason I say repost
is that this thread is a couple of days old and people tend to look at
newer ones.
Nov 13 '05 #5

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

Similar topics

4
by: google | last post by:
Hi there, I've searched high and low for this, but it seems most people are looking to establish (and control) the relationship between a parent browser window and it's associated child window...
18
by: Roger Withnell | last post by:
I open a new window from the current window to display maps. Several maps of different sizes can be displayed. The function is given the size of the map and adjusts the window size accordingly....
2
by: David | last post by:
Hello, I have an application that has been running for years and had little problem with it. We've been retesting the latest code under Windows 2003 and found a surprise. There is a certain...
2
by: Paul Steele | last post by:
Is there any way to check for open Explorer windows and if any are found, tell Windows Explorer to close them. I don't want a brute force method of killing Explorer and letting it restart. I'd...
1
by: RJN | last post by:
Hi Sorry for posting again. I open a few pop-up windows from a main window. If session time out occurs in either the main window or the pop-up windows ,I redirect the user to login screen....
1
by: Mike Kober | last post by:
I'm having difficulty getting this to work. Any help would be appreciated. What I'm trying to do is to open Explorer onto the Windows/fonts directory and then close it. I've added a font...
7
by: Lee | last post by:
Hey all, I'm using the following code to send stuff accross the network, appologies for it being in full, but I've really no idea exactly where this error is occuring. =======network...
1
by: qiong | last post by:
Dear friends, Good evening, I have some problems with finding keyword ":\" for each cell. My objective is to find that keyword in each cell in each worksheet which represent the link. Eg:...
4
by: =?Utf-8?B?VG9yZW4gVmFsb25l?= | last post by:
Was editing code, am getting the following errors } expected Type or namespace definition, or end-of-file expected Eyes crossed cannot find code below! using System; using...
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:
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...
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
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.