Open wb from a wb and run a macro

G

Guest

This is hard top describe in a a title.
I would like to be working in one workbook (wb) select a cell that has any
type of data and search for that data in another wb that may or may not be
open.

I am mainly stumbling due to Excel 2007 which seems to have some quirks for
me to work thru :lol:

As always, any help is appreciated!
 
R

Ronald R. Dodge, Jr.

This issue as far as I'm concerned goes all the way back to Excel 97 at
least when VBA was first introduced to Excel. We use a vendor for pulling
data from our database system and take the data into Excel. With me being
one of 2 far advanced MS Office users and VBA programmers within the
division, I not only link the queries to Excel via the third party tool, but
also use the various events setup in it. Anyhow, the vendor has specified
that for any workbook with queries linked to it, The workbook name can not
have a single space in it. However, you can use the underscore (_) in place
of the space to get around this issue.

When I am linking a procedure to an event of the vendor, it has to be in the
format of:

WorkbookName.xls!ModuleName.ProcedureName

When you think about it, can any module and/or procedure name have a single
space in it?

Obviously no as spaces have a lot of other significations in the coding
world. For this reason, I can see why spaces don't work as it would be the
same as if you would be attempting to use the function of CallByName, and
it's procname argument can't contain any spaces in it either (True, the help
file doesn't state that, but have you ever seen a procedure or object name
contain a space within it's code name?) In this case, it's using the
workbook name as if it's a code name for the workbook.

--
Thanks,

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top