ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   tasks-Object ??? or an alternative (https://www.excelbanter.com/excel-programming/323424-tasks-object-alternative.html)

M.Erlinger

tasks-Object ??? or an alternative
 
Hello

i'm new in excel-programming - and have following problem:

i have in word-vba this makro:
*For Each mytask In Tasks
* If mytask.Name = "Document_Work" Then
* Application.Visible = False
* mytask.SendWindowMessage 1024, 0, 0
* End If
*Next mytask
to find out the application who started this word-session and go back to
this application.

now i want do the same in excel - but i saw, that there is no
"tasks"-object - how could i solve this problem in excel-vba - or who know's
an good alternative-solution.

many thank's in advance
Michael E.



Bob Phillips[_6_]

tasks-Object ??? or an alternative
 
YOu could use automation to call into word, like so

Dim wordApp As Object

Set wordApp = CreateObject("Word.Application")
If wordApp.Tasks.Exists("Microsoft Powerpoint") = False Then
MsgBox "No powerpoint"
End If
Set wordApp = Nothing


--

HTH

RP
(remove nothere from the email address if mailing direct)


"M.Erlinger" wrote in message
...
Hello

i'm new in excel-programming - and have following problem:

i have in word-vba this makro:
*For Each mytask In Tasks
* If mytask.Name = "Document_Work" Then
* Application.Visible = False
* mytask.SendWindowMessage 1024, 0, 0
* End If
*Next mytask
to find out the application who started this word-session and go back to
this application.

now i want do the same in excel - but i saw, that there is no
"tasks"-object - how could i solve this problem in excel-vba - or who

know's
an good alternative-solution.

many thank's in advance
Michael E.





Bob Phillips[_6_]

tasks-Object ??? or an alternative
 
Or probably easier to just test for the app like so

Dim App As Object

On Error Resume Next
Set App = GetObject(, "Powerpoint.Application")
If App Is Nothing Then
MsgBox "No powerpoint"
End If
Set App = Nothing


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Phillips" wrote in message
...
YOu could use automation to call into word, like so

Dim wordApp As Object

Set wordApp = CreateObject("Word.Application")
If wordApp.Tasks.Exists("Microsoft Powerpoint") = False Then
MsgBox "No powerpoint"
End If
Set wordApp = Nothing


--

HTH

RP
(remove nothere from the email address if mailing direct)


"M.Erlinger" wrote in message
...
Hello

i'm new in excel-programming - and have following problem:

i have in word-vba this makro:
*For Each mytask In Tasks
* If mytask.Name = "Document_Work" Then
* Application.Visible = False
* mytask.SendWindowMessage 1024, 0, 0
* End If
*Next mytask
to find out the application who started this word-session and go back to
this application.

now i want do the same in excel - but i saw, that there is no
"tasks"-object - how could i solve this problem in excel-vba - or who

know's
an good alternative-solution.

many thank's in advance
Michael E.








All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com