Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default VBA code to switch to other application

I making an application in Excel that copies the content of a range to any
other running application on the computer, as can be done by a manual
copy/paste action.
However I want to automate the alt-tab key command (for switching to the
former application). What is the propriate VBA code for this action?

Thanks in advance,

Jan Bart
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA code to switch to other application

You can use the Create.Object command from Excel to open another application
such as Word, e.g.

Dim oApp As Object
Set oApp = CreateObject("Word.Application")
Set oDoc = oApp.documents.New
oApp.Visible = True


JM


"Excelerate-nl" wrote:

I making an application in Excel that copies the content of a range to any
other running application on the computer, as can be done by a manual
copy/paste action.
However I want to automate the alt-tab key command (for switching to the
former application). What is the propriate VBA code for this action?

Thanks in advance,

Jan Bart

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default VBA code to switch to other application

Dear JM,

I only would like to switch to an already open application that I would also
get when I use the Alt-tab key command.

Regards,

Jan Bart

"SeaparkJohn" wrote:

You can use the Create.Object command from Excel to open another application
such as Word, e.g.

Dim oApp As Object
Set oApp = CreateObject("Word.Application")
Set oDoc = oApp.documents.New
oApp.Visible = True


JM


"Excelerate-nl" wrote:

I making an application in Excel that copies the content of a range to any
other running application on the computer, as can be done by a manual
copy/paste action.
However I want to automate the alt-tab key command (for switching to the
former application). What is the propriate VBA code for this action?

Thanks in advance,

Jan Bart

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA code to switch to other application


I don't think you can do that from excel, as Excel can only control an
instance of an application that it has created itself. If you want to
control already-open applications, you would need to write a Windows
Application.
"Excelerate-nl" wrote:

Dear JM,

I only would like to switch to an already open application that I would also
get when I use the Alt-tab key command.

Regards,

Jan Bart

"SeaparkJohn" wrote:

You can use the Create.Object command from Excel to open another application
such as Word, e.g.

Dim oApp As Object
Set oApp = CreateObject("Word.Application")
Set oDoc = oApp.documents.New
oApp.Visible = True


JM


"Excelerate-nl" wrote:

I making an application in Excel that copies the content of a range to any
other running application on the computer, as can be done by a manual
copy/paste action.
However I want to automate the alt-tab key command (for switching to the
former application). What is the propriate VBA code for this action?

Thanks in advance,

Jan Bart

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VBA code to switch to other application

Well, I am using AppActivate to send data to "Exact voor Windows"
(accounting software) combined with SendKeys. Works fine.
Within Win2K and Excel2K that is, pls see my other post.




"SeaparkJohn" wrote in message
...

I don't think you can do that from excel, as Excel can only control an
instance of an application that it has created itself. If you want to
control already-open applications, you would need to write a Windows
Application.
"Excelerate-nl" wrote:

Dear JM,

I only would like to switch to an already open application that I would
also
get when I use the Alt-tab key command.

Regards,

Jan Bart

"SeaparkJohn" wrote:

You can use the Create.Object command from Excel to open another
application
such as Word, e.g.

Dim oApp As Object
Set oApp = CreateObject("Word.Application")
Set oDoc = oApp.documents.New
oApp.Visible = True


JM


"Excelerate-nl" wrote:

I making an application in Excel that copies the content of a range
to any
other running application on the computer, as can be done by a manual
copy/paste action.
However I want to automate the alt-tab key command (for switching to
the
former application). What is the propriate VBA code for this action?

Thanks in advance,

Jan Bart





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VBA code to switch to other application

If it is constantly the same app you're switching to you can use the
AppActivate statement.
For example:

appactivate "Microsoft Word"
appactivate thisworkbook.name (to switch back)


"Excelerate-nl" wrote in message
...
Dear JM,

I only would like to switch to an already open application that I would
also
get when I use the Alt-tab key command.

Regards,

Jan Bart

"SeaparkJohn" wrote:

You can use the Create.Object command from Excel to open another
application
such as Word, e.g.

Dim oApp As Object
Set oApp = CreateObject("Word.Application")
Set oDoc = oApp.documents.New
oApp.Visible = True


JM


"Excelerate-nl" wrote:

I making an application in Excel that copies the content of a range to
any
other running application on the computer, as can be done by a manual
copy/paste action.
However I want to automate the alt-tab key command (for switching to
the
former application). What is the propriate VBA code for this action?

Thanks in advance,

Jan Bart



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
Switch to another application Selina Excel Programming 1 April 23rd 05 07:31 PM
VBA Code to switch view Adrian[_7_] Excel Programming 2 August 29th 04 10:14 PM
Application.run Macro Code Problem Todd Huttenstine Excel Programming 1 August 21st 04 08:23 PM
Application error with VBA code jd Excel Programming 1 May 6th 04 09:42 AM
Number Switch Code Joe B.[_3_] Excel Programming 3 January 10th 04 10:09 PM


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