PC Review


Reply
Thread Tools Rate Thread

Can someone explian to me what this line of code does?

 
 
Ayo
Guest
Posts: n/a
 
      15th Mar 2010
Shell (CStr([GoogleEarthExecutableLocation]) & " " & sfilename)
 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      15th Mar 2010
The Shell command is used to start another application. In this case,
it would appear that there is a named range called
GoogleEarthExecutable that contains the full file name of the Goggle
Earth program. The square brackets [ ] cause "GoogleEarthExecutable"
to be replace with the contents of that cell. Then, the CStr converts
that text into a string data format. The & " " & sfilename appends a
space followed by the contents of the variable named sfilename to the
exe file name. Finally, that whole string is passed to Shell which
executes it.

It is essentially the equivalent to

Shell "C:\Program Files\GoogleEarth.exe C:\SomeFileName.txt"

This starts the program C:\Program Files\GoogleEarth.exe and passes
the text "C:\SomeFileName.txt" to the program, which uses it in some
fashion unbeknownst to me.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com



On Mon, 15 Mar 2010 10:49:01 -0700, Ayo
<(E-Mail Removed)> wrote:

>Shell (CStr([GoogleEarthExecutableLocation]) & " " & sfilename)

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro code to put series name next to individual line in line grap Otani Microsoft Excel Charting 3 23rd Feb 2010 07:24 PM
Code to read file in reverse fast line by line ChristopherL Microsoft Excel Programming 3 1st Oct 2008 12:45 AM
Single line of code with line separator KarenF Microsoft Excel Programming 4 19th Aug 2008 01:43 AM
how to set up a thickness of a line in visual basic code for one selected line in chart in MS Access `97 Kamyk Microsoft Access Form Coding 0 2nd Jul 2004 04:59 PM
How to set up a bold line in visual basic code for one selected line in chart Kamyk Microsoft Access Forms 0 2nd Jul 2004 04:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:21 PM.