Re: How to pass Excel cell value to VB app variable?
From: Duane Bozarth (dp_bozarth_at_swko.dot.net)
Date: 05/04/04
- Next message: Rick Lederman: "Re: Resource strings & VB6"
- Previous message: Noel Rico Tecson: "LIST BOX in DATAGRID contol"
- In reply to: Ed: "Re: How to pass Excel cell value to VB app variable?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 03 May 2004 20:13:29 -0500
Ed wrote:
>
> Bob and Duane: Thanks for all your help, but I'm just not getting it. I
> set a variable strFPath, my file name, and the StrCell, then in VBA tried
> Shell strFPath & "filename.exe" & strCell in just about every possible
> combination of parentheses and double quotes I could think of, and I
> couldn't make it work. Without the strCell, I could get the VB app to
> launch using the parentheses and quotes as below, but no other way. But I
> couldn't get VBA to accept the extra variable. ...snip...
You don't need another variable, what you're trying to do is to build a
single string variable that contains the <entire> command you want to
pass to Shell and use that variable as the argument to Shell.
To debug, build the command string and test print it or look at it in
the IDE until you get it right. Of course, building the string
hardcoded once and getting that to work and then replace the hardcoded
variable value with the cell variable and getting that to reproduce the
same string as the hardcoded version is another incremental step on the
way.
It <will> work if you get the command string built correctly and it will
be much easier to see you have it right (or what's wrong) if you simply
print out the string until you do get it...
If all else fails, post the actual/exact code you're using to build the
command string and somebody here will spot the problem pretty quickly,
no doubt...
- Next message: Rick Lederman: "Re: Resource strings & VB6"
- Previous message: Noel Rico Tecson: "LIST BOX in DATAGRID contol"
- In reply to: Ed: "Re: How to pass Excel cell value to VB app variable?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|