Solved

About handle...vb 6

Posted on 2004-09-08
1
152 Views
Last Modified: 2012-05-05
I will be opening some excel files and close one or few off and on from a vb 6 form.  Could handl HWND be utilized to do this?

- Store file names and its HWND value in a temp table (There might be number of file open at the same time).
- Later on, select file you whish to close it, the code is expected to use HWND value for the selected file to close, from a temp table, to close the file.

I don't have a good grasp of HWND.  Is it something that could be used this way?

Thanks,
0
Comment
Question by:Mike Eghtebas
1 Comment
 
LVL 76

Accepted Solution

by:
David Lee earned 250 total points
Comment Utility
Why would you want to?  You can open all workbooks in a single Excel application object.  That means you already know the name of the object containing the workbooks.  Workbook objects don't have an HWND property only the Excel application does and you already know its name.  I don't see that there's any value in this.  Even if you were going to have multiple Excel application objects, which I also don't see any real value in, it'd be far easier to use a collection object to hold them all.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VBA open file from excel cell 4 33
MsgBox 2 36
Saving history changes to sub form 4 24
Run code from text file in vb 1 32
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now