Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Can someone explian to me what this line of code does?

Shell (CStr([GoogleEarthExecutableLocation]) & " " & sfilename)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Can someone explian to me what this line of code does?

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
wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro code to put series name next to individual line in line grap Otani Charts and Charting in Excel 3 February 23rd 10 07:24 PM
To join 1st line & 2nd line of text in text in Excel VBA Code norhaya[_2_] Excel Programming 8 October 10th 09 01:31 PM
Code to read file in reverse fast line by line ChristopherL Excel Programming 3 October 1st 08 12:45 AM
Single line of code with line separator KarenF Excel Programming 4 August 19th 08 01:43 AM
Continue line of VBA code on the next line peacelittleone Excel Programming 9 June 24th 05 07:46 PM


All times are GMT +1. The time now is 02:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"