Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Open non MS applications

I would like to open a non MS application in running my Macro.
I just want to copy and paste a range per my spreadsheet to the editor of
that application.
How can I choose "select all" and paste the whole range in order to
overwrite all existing data in that application ? If positive, is it
possible to execute some basic commands keys (like save file ...etc) in that
application ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Open non MS applications

Look at Shell and Sendkeys commands

--
Regards,
Tom Ogilvy



"Frankie" wrote:

I would like to open a non MS application in running my Macro.
I just want to copy and paste a range per my spreadsheet to the editor of
that application.
How can I choose "select all" and paste the whole range in order to
overwrite all existing data in that application ? If positive, is it
possible to execute some basic commands keys (like save file ...etc) in that
application ?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Open non MS applications

Hi,

I opened the app. using Shell commands but I don't know how to execute
simple command like select all & paste. I try sendkeys command but it works
within excel only. Shall be pleased if you can give some clues.

Rgds,

"Tom Ogilvy" wrote:

Look at Shell and Sendkeys commands

--
Regards,
Tom Ogilvy



"Frankie" wrote:

I would like to open a non MS application in running my Macro.
I just want to copy and paste a range per my spreadsheet to the editor of
that application.
How can I choose "select all" and paste the whole range in order to
overwrite all existing data in that application ? If positive, is it
possible to execute some basic commands keys (like save file ...etc) in that
application ?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Open non MS applications

Hi,

I tried to use sendkeys commands but it only applies in office 2000 or
previous versions. Can you pls advise how I shall change the Sendkeys
commands in order to make them work in office 2003 ?

Thanks.

Rgds,


"Frankie" wrote:

Hi,

I opened the app. using Shell commands but I don't know how to execute
simple command like select all & paste. I try sendkeys command but it works
within excel only. Shall be pleased if you can give some clues.

Rgds,

"Tom Ogilvy" wrote:

Look at Shell and Sendkeys commands

--
Regards,
Tom Ogilvy



"Frankie" wrote:

I would like to open a non MS application in running my Macro.
I just want to copy and paste a range per my spreadsheet to the editor of
that application.
How can I choose "select all" and paste the whole range in order to
overwrite all existing data in that application ? If positive, is it
possible to execute some basic commands keys (like save file ...etc) in that
application ?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Open non MS applications

SendKeys sends keystrokes to another program. So you have to be able to do
what you want using only the keyboard. Eg., Ctrl+V to paste
This a Word macro, but most of it is not specific to Word.
Before I run it, I select a picture.
The macro copies the picture, goes to the Paint program (which doesn't have
VBA), which is already open (it could be opened programmatically, if desired).
It uses SendKeys to
select everything already in Paint and delete it,
copy the picture from the clipboard to Paint
Tell Paint to invert the colors
copy the new picture from Paint to the clipboard
replace the picture in Word with the new picture from the clipboard

As you can see from the comment, I wasn't able to do everything in Paint
with a single SendKeys, for some reason. Maybe timing? So you might have to
play around to get it working right.
good luck

Sub InvertColors()
'
' InvertColors Macro
' Macro recorded 7/11/2006 by Patricia Shannon
' Invert colors of a picture, using Paint program
' Picture must be selected before macro is run
' At end of macro, the macro selects the next picture.
' Recommend turning off collection of multiple copied items into Clipboard
' to avoid problem with Paint when Clipboard is full :
' In Clipboard, turn off all options.
' If Paint gets hung up, in Word, open clipboard, clear clipboard, close
clipboard.
'
'
' ---- Word commands ---
Selection.Copy ' copy selected picture

' --- run Paint

AppActivate "untitled - Paint"
''' Note: Sendkeys Ctrl-codes (eg. "^A") do not work with Paint
''' SendKeys "%EA%EP%II%EC%{TAB}", True
''' actions ended after paste (%EP)
''' SendKeys "^A^V^C%{TAB}", True ' Ctrl-A Ctrl-V Ctrl-C return to
this application

''' Note: Commands after paste (%EP) were ignored, therefore multiple
''' SendKeys were needed
SendKeys "%EA%EP", True
AppActivate "untitled - Paint"
'''SendKeys "%II%EC%{TAB}", True
SendKeys "%II%ET%{TAB}", True


' ---- Word commands ---
Selection.Delete Unit:=wdCharacter, Count:=1 ' delete old picture
Selection.Paste ' copied converted picture
Selection.MoveLeft Unit:=wdWord, Count:=1 ' scroll left

SelectNextGraphic

ClearClipboard

End Sub




"Frankie" wrote:

I would like to open a non MS application in running my Macro.
I just want to copy and paste a range per my spreadsheet to the editor of
that application.
How can I choose "select all" and paste the whole range in order to
overwrite all existing data in that application ? If positive, is it
possible to execute some basic commands keys (like save file ...etc) in that
application ?



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
Why does Exel open much slower than other applications? Andre Excel Discussion (Misc queries) 0 March 24th 09 08:37 PM
Can't open Excel files from other applications Paul Excel Discussion (Misc queries) 1 February 10th 09 01:43 PM
check Open Excel applications Zurn[_56_] Excel Programming 0 May 8th 06 07:29 AM
Macro to open other applications Sherry Excel Programming 2 October 1st 04 10:50 PM
Hide (visible=false) all open applications? Joe 90[_2_] Excel Programming 4 October 23rd 03 06:04 PM


All times are GMT +1. The time now is 06:39 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"