Loading ...
Sorry, an error occurred while loading the content.
 

Launch a File in Excel

Expand Messages
  • R Shapp
    Hi Group, Trying to learn how to write clips: I want to launch a specific file in Excel. The clip below does exactly what I want. It was built by modifying
    Message 1 of 11 , Oct 3, 2004
      Hi Group,

      Trying to learn how to write clips:

      I want to launch a specific file in Excel. The clip below does exactly what I
      want. It was built by modifying the existing "Launch Calculator" clip that
      came with NTP, however, the following questions remain:

      1. Help says that ^!FocusApp requires an asterisk if the text isn't an exact
      match of the title bar of the application. I didn't use an asterisk, but
      ^!FocusApp seems to work as desired even though the full title is "Microsoft
      Excel Book 1" when Excel opens.

      2. Why does ^!FocusApp come before the ^!Shell command?

      3. The logic of the ^!IfError command looks backwards. If the application is
      found, no error has occurred. What error is causing the jump to Next?

      4. I had to rename the spreadsheet to eliminate a blank space that was in the
      original name. Enclosing the file name in quotes didn't work. Please tell me
      why the two variations immediately below in the next few lines didn't work:

      ^!Shell "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE"
      "C:\Utils\Graph paper1.xls"
      ^!Shell "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE C:\Utils\Graph
      paper1.xls"

      When I ran these variations, a correctly named file was at the specified
      location, but the error message was something like 'file not found'.

      Please also tell me how to avoid the need to rename the target file.

      5. Is there a keyboard shortcut to launch edit mode when I have selected a
      clip to work on? Similarly, after I save modifications to a clip, is there a
      keyboard shortcut to exit edit mode?

      6. I am very receptive to any suggestions you might make for improving on
      this effort.

      Thank you for the help.

      Ray Shapp
      NTPro v4.95, WinXP Home

      ********clip begins on following line*********
      Launch Excel

      ^!FocusApp Microsoft Excel
      ^!IfError Next Else End
      ^!Shell "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE"
      "C:\Utils\Graph_paper1.xls"
    • Alan
      ... [ . . ] ... If that is all that you want to do then only the one shell line should suffice (or: do it). With perhaps exception of multiple instances of
      Message 2 of 11 , Oct 3, 2004
        R Shapp wrote:
        > Hi Group,
        [ . . ]
        > I want to launch a specific file in Excel.

        If that is all that you want to do then only the one shell line should
        suffice (or: do it).

        With perhaps exception of multiple instances of spreadsheet .exe .
        but, likely is only one instance of spreadsheet app allowed. so,
        correspondingly likeley that the exception also is not applicable.


        [ . (no ideas on that/those for you, sorry) . ]
        > 4. I had to rename the spreadsheet to eliminate a blank space that was in the
        > original name. Enclosing the file name in quotes didn't work. Please tell me
        > why the two variations immediately below in the next few lines didn't work:
        >
        > ^!Shell "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE"
        > "C:\Utils\Graph paper1.xls"
        > ^!Shell "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE C:\Utils\Graph
        > paper1.xls"
        >
        > When I ran these variations, a correctly named file was at the specified
        > location, but the error message was something like 'file not found'.
        >
        > Please also tell me how to avoid the need to rename the target file.

        help > help on clip programming > then get the index or whatever tab
        that allows you to scroll up and down all the individual clip language
        items > scroll down to and look at: $getshort()$

        ^!Shell "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE"
        $getshort(C:\Utils\Graph paper1.xls)$

        or

        ^!Set %xlapp%=$getshort(C:\Program Files\Microsoft
        Office\Office10\EXCEL.EXE)$
        ^!Set %xlfile%=$getshort(C:\Utils\Graph paper1.xls)$
        ^!Shell "^%xlapp% ^%xlfile%"

        [ . . ]
        > ********clip begins on following line*********
        > Launch Excel
        >
        > ^!FocusApp Microsoft Excel
        > ^!IfError Next Else End
        > ^!Shell "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE"
        > "C:\Utils\Graph_paper1.xls"
      • R Shapp
        Thanks, Alan, for the quick reply. You said: Merely learning
        Message 3 of 11 , Oct 3, 2004
          Thanks, Alan, for the quick reply.

          You said: <<If that is all that you want to do then only the one shell line
          should suffice (or: do it).>>

          Merely learning how to launch an application with a specific file will be a
          milestone for me. I will later want to be able to invoke it from within a
          NoteTab Outline Document.

          Using the ^$GetShort()$ function as you suggest works fine. My revised clip
          is shown below. I tried it with and without the quotes around
          ^$GetShort(C:\Utils\Graph paper1.xls)$. It doesn't matter whether the quotes
          are present or absent. I am grateful for your help on that.

          I am repeating here those of my original questions which were not addressed.


          1. Help says that ^!FocusApp requires an asterisk if the text isn't an
          exact
          match of the title bar of the application. I didn't use an asterisk, but
          ^!FocusApp seems to work as desired even though the full title is
          "Microsoft
          Excel Book 1" when Excel opens.

          2. Why does ^!FocusApp come before the ^!Shell command?

          3. The logic of the ^!IfError command looks backwards. If the
          application is
          found, no error has occurred. What error is causing the jump to Next?

          <snip>

          5. Is there a keyboard shortcut to launch edit mode when I have selected
          a
          clip to work on? Similarly, after I save modifications to a clip, is
          there a
          keyboard shortcut to exit edit mode?

          6. I am very receptive to any suggestions you might make for improving on
          this effort.


          Thank you again.

          Ray Shapp

          ******revised clip begins on next line*********
          Launch Excel

          ^!FocusApp Microsoft Excel
          ^!IfError Next Else End
          ^!Shell "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE"
          "^$GetShort(C:\Utils\Graph paper1.xls)$"
        • Alec Burgess
          RaY: I am repeating here those of my original questions which ... WAG: its implied? ... Exactly: If its found then take the ELSE branch and goto END, but if
          Message 4 of 11 , Oct 4, 2004
            RaY:


            I am repeating here those of my original questions which
            > were not addressed.
            >
            >
            > 1. Help says that ^!FocusApp requires an asterisk if
            > the text isn't an exact
            > match of the title bar of the application. I didn't
            > use an asterisk, but ^!FocusApp seems to work as
            > desired even though the full title is "Microsoft
            > Excel Book 1" when Excel opens.

            WAG: its implied?

            >
            > 2. Why does ^!FocusApp come before the ^!Shell
            > command?
            >
            > 3. The logic of the ^!IfError command looks
            > backwards. If the application is
            > found, no error has occurred. What error is causing
            > the jump to Next?

            Exactly: If its found then take the ELSE branch and goto END, but if
            FocusApp fails (because application does *NOT* exist, take the NEXT branch
            and launch it.
            >
            > <snip>
            >
            > 5. Is there a keyboard shortcut to launch edit mode
            > when I have selected a
            > clip to work on? Similarly, after I save
            > modifications to a clip, is there a
            > keyboard shortcut to exit edit mode?

            This I don't know ...

            Regards ... Alec
            --


            ---- Original Message ----
            From: "R Shapp" <ras45@...>
            To: <ntb-clips@yahoogroups.com>
            Sent: Sunday, October 03, 2004 21:51
            Subject: [gla: Re: [Clip] Launch a File in Excel

            > Thanks, Alan, for the quick reply.

            <snip>
            > ******revised clip begins on next line*********
            > Launch Excel
            >
            > ^!FocusApp Microsoft Excel
            > ^!IfError Next Else End
            > ^!Shell "C:\Program Files\Microsoft
            > Office\Office10\EXCEL.EXE" "^$GetShort(C:\Utils\Graph
            > paper1.xls)$"
          • Jody
            Hi Alec & Ray, ... Not that I am aware of. There might be something shorter than this: Ctrl+F6 Tab Shift+F10 DownArrow Enter AFAIK, mouse, right click,
            Message 5 of 11 , Oct 4, 2004
              Hi Alec & Ray,

              > 5. Is there a keyboard shortcut to launch edit mode when I
              > have selected a clip to work on?

              Not that I am aware of. There might be something shorter than this:
              Ctrl+F6 Tab Shift+F10 DownArrow Enter <bg>

              AFAIK, mouse, right click, Edit Clip is a lot shorter. :)

              > Similarly, after I save modifications to a clip, is there a
              > keyboard shortcut to exit edit mode?

              It's like any document: Ctrl+F4.

              Happy Clip'n!
              Jody

              www.clean-funnies.com, http://www.fookes.us/maillist.htm

              Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
              UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
              Options: http://groups.yahoo.com/group/ntb-clips
            • R Shapp
              Hi Alec and Jody, Thank you for your replies. I do comprehend all that you have said (and I appreciate your help). I discovered that all of the Excel window
              Message 6 of 11 , Oct 4, 2004
                Hi Alec and Jody,

                Thank you for your replies.

                I do comprehend all that you have said (and I appreciate your help). I
                discovered that all of the Excel window title text (including the hyphen) is
                necessary to avoid re-launching this spreadsheet if it is already open.

                (Note: The clip is included below my signature.)

                Do you know of a way to copy the title text of a window? I made several
                errors in retyping the title before I finally got it right.

                Thanks again for the help.

                Ray Shapp

                ********clip begins on following line*********
                Launch Excel

                ^!FocusApp Microsoft Excel - Graph paper1.xls
                ^!IfError Next Else End
                ^!Shell "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE"
                ^$GetShort(C:\Utils\Graph paper1.xls)$
                ^!Info Flow DID arrive here.^pNormal end.
              • Alec Burgess
                ... Ask and it shall be found :-) API Spy+++ http://www.geocities.com/prototype_terrizer/VBToolz.htm Regards ... Alec -- ... From: R Shapp
                Message 7 of 11 , Oct 4, 2004
                  > Do you know of a way to copy the title text of a window?

                  Ask and it shall be found :-)
                  API Spy+++ http://www.geocities.com/prototype_terrizer/VBToolz.htm


                  Regards ... Alec
                  --


                  ---- Original Message ----
                  From: "R Shapp" <ras45@...>
                  To: <ntb-clips@yahoogroups.com>
                  Sent: Monday, October 04, 2004 22:22
                  Subject: [gla: Re: [Clip] Launch a File in Excel

                  > Hi Alec and Jody,
                  >
                  > Thank you for your replies.
                  >
                  > I do comprehend all that you have said (and I appreciate
                  > your help). I discovered that all of the Excel window
                  > title text (including the hyphen) is necessary to avoid
                  > re-launching this spreadsheet if it is already open.
                  >
                  > (Note: The clip is included below my signature.)
                  >
                  > Do you know of a way to copy the title text of a window?
                  > I made several errors in retyping the title before I
                  > finally got it right.
                  >
                  > Thanks again for the help.
                  >
                  > Ray Shapp
                  >
                  > ********clip begins on following line*********
                  > Launch Excel
                  >
                  > ^!FocusApp Microsoft Excel - Graph paper1.xls
                  > ^!IfError Next Else End
                  > ^!Shell "C:\Program Files\Microsoft
                  > Office\Office10\EXCEL.EXE" ^$GetShort(C:\Utils\Graph
                  > paper1.xls)$ ^!Info Flow DID arrive here.^pNormal end.
                  >
                  >
                  >
                  >
                  >
                  > ------------------------ Yahoo! Groups Sponsor
                  > --------------------~--> Make a clean sweep of pop-up
                  > ads. Yahoo! Companion Toolbar.
                  > Now with Pop-Up Blocker. Get it for free!
                  > http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dkFolB/TM
                  > --------------------------------------------------------------------~->
                  >
                  >
                  > Yahoo! Groups Links
                  >
                  >
                  >
                • Larry Hamilton
                  Here is an oldie but a goodie from Larry Thomas. When you focus a program, its title bar gets copied. I use this every time I want to make sure I have the
                  Message 8 of 11 , Oct 4, 2004
                    Here is an oldie but a goodie from Larry Thomas. When you focus a
                    program, its title bar gets copied. I use this every time I want to make
                    sure I have the exact titlebar text when I work on such a clip.

                    All lines begin with ; or : or ^.

                    H="GetApptitle"
                    ;Larry Thomas <larryt@...>
                    ;08/21/1999, 12:12:03 PM
                    ^!SetClipboard=^%Empty%
                    :Loop
                    ^!If ^$StrCopy("^$GetAppTitle$";1;11)$ = "NoteTab Pro" Loop Else Next
                    :Loop2
                    ^!Delay 10
                    ^!SetClipboard ^$GetClipboard$^$GetAppTitle$^%nl%
                    ^!If ^$StrCopy("^$GetAppTitle$";1;11)$ <> "NoteTab Pro" Loop2 Else Next
                    ^!Toolbar Paste New

                    HTH,

                    Larry Hamilton
                    lmh@...
                    My Webpage
                    http://members.tripod.com/~notlimah/index.htm

                    R Shapp wrote:
                    > Hi Alec and Jody,
                    >
                    > Thank you for your replies.
                    >
                    > I do comprehend all that you have said (and I appreciate your help). I
                    > discovered that all of the Excel window title text (including the hyphen) is
                    > necessary to avoid re-launching this spreadsheet if it is already open.
                    >
                    > (Note: The clip is included below my signature.)
                    >
                    > Do you know of a way to copy the title text of a window? I made several
                    > errors in retyping the title before I finally got it right.
                    >
                    > Thanks again for the help.
                    >
                    > Ray Shapp
                    >
                    > ********clip begins on following line*********
                    > Launch Excel
                    >
                    > ^!FocusApp Microsoft Excel - Graph paper1.xls
                    > ^!IfError Next Else End
                    > ^!Shell "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE"
                    > ^$GetShort(C:\Utils\Graph paper1.xls)$
                    > ^!Info Flow DID arrive here.^pNormal end.
                  • Jody
                    Hi Ray, ... ^!FocusApp *Excel* ^!Delay 2 ^!Info ^$GetAppTitle$ Happy Clip n! Jody www.clean-funnies.com, http://www.fookes.us/maillist.htm Subscribe:
                    Message 9 of 11 , Oct 4, 2004
                      Hi Ray,

                      >> Do you know of a way to copy the title text of a window?

                      ^!FocusApp *Excel*
                      ^!Delay 2
                      ^!Info ^$GetAppTitle$


                      Happy Clip'n!
                      Jody

                      www.clean-funnies.com, http://www.fookes.us/maillist.htm

                      Subscribe: mailto:ntb-Clips-Subscribe@yahoogroups.com
                      UnSubscribe: mailto:ntb-Clips-UnSubscribe@yahoogroups.com
                      Options: http://groups.yahoo.com/group/ntb-clips
                    • R Shapp
                      Hi Alec and Larry, Thanks for the App Title grabbers. In the clip by Larry Thomas, why is the second part in a loop (Loop2)? It appears to make a copy of the
                      Message 10 of 11 , Oct 4, 2004
                        Hi Alec and Larry,

                        Thanks for the App Title grabbers.

                        In the clip by Larry Thomas, why is the second part in a loop (Loop2)? It
                        appears to make a copy of the title every ten seconds as long as the app is in
                        focus. Why not just grab the title once and paste it?

                        Alec, the Toolz site has the aura of evil about it. Are you reasonably sure
                        the contents are benign?

                        Regards,

                        Ray Shapp

                        H="GetApptitle"
                        ;Larry Thomas <larryt@...>
                        ;08/21/1999, 12:12:03 PM
                        ^!SetClipboard=^%Empty%
                        :Loop
                        ^!If ^$StrCopy("^$GetAppTitle$";1;11)$ = "NoteTab Pro" Loop Else Next
                        :Loop2
                        ^!Delay 10
                        ^!SetClipboard ^$GetClipboard$^$GetAppTitle$^%nl%
                        ^!If ^$StrCopy("^$GetAppTitle$";1;11)$ <> "NoteTab Pro" Loop2 Else Next
                        ^!Toolbar Paste New
                      • Larry Hamilton
                        Ray, The loop is if you want to grab titles for more than one program. Otherwise you can cancel the clip. Larry Hamilton lmh@hamiltongensociety.org My Webpage
                        Message 11 of 11 , Oct 6, 2004
                          Ray,

                          The loop is if you want to grab titles for more than one program.
                          Otherwise you can cancel the clip.

                          Larry Hamilton
                          lmh@...
                          My Webpage
                          http://members.tripod.com/~notlimah/index.htm

                          R Shapp wrote:
                          > Hi Alec and Larry,
                          >
                          > Thanks for the App Title grabbers.
                          >
                          > In the clip by Larry Thomas, why is the second part in a loop (Loop2)? It
                          > appears to make a copy of the title every ten seconds as long as the app is in
                          > focus. Why not just grab the title once and paste it?
                          >
                          > Alec, the Toolz site has the aura of evil about it. Are you reasonably sure
                          > the contents are benign?
                          >
                          > Regards,
                          >
                          > Ray Shapp
                        Your message has been successfully submitted and would be delivered to recipients shortly.