When manipulating Word from Excel, you have to set Word app to visible, but you don't have to when you work with PowerPoint App. Why?

Jamualson

Board Regular
Joined
Feb 17, 2021
Messages
145
Office Version
  1. 2019
Platform
  1. Windows
1. If I don't set it to visible, Word is not visible. But at PowerPoint, this step is not needed, PowerPoint is visible no matter what. Why?

2.
I think i know the cause -->

- It seems to me that when creating a new Word application, it launches literally a new application (I tested things with Late Binding) every time i launch the code. If i launch 5 times, then 5 seperate Word app is running (but where is this file, hidden? Or I can find it somewhere? Where does it exist)
- but when I launch the PowerPoint app making code, lets say 5 times (late binding still), it doesnt make seperate apps actually, it stops at the 1 and only adds new presentations. However, late binding should launch a seperate copy of powerpoint app.

I think this is in correlation with the "visible" thing too. (1 causes 2)

Thank you very much for your idea, I find this behaviour a little strange.

Sub Test()

Dim wApp As Object
Set wApp = CreateObject("Word.Application")

Dim wDoc As Word.Document
Set wDoc = wApp.Documents.Add(Template:="Normal")

wApp.Visible = True

Set wApp = Nothing

End Sub
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Late or early binding shouldn't make any difference to whether an app launches as a separate instance or not. Some apps are multi-instance by default, some are not.
 
Upvote 0
Whether you need 'wApp.Visible = True' really depends on what you're doing in Word. I regularly use 'wApp.Visible = False' (or the equivalent thereof. Employing 'wApp.Visible = True' can be useful while your code isn't fully tested, though, and is essential if you want to view whatever document(s) you're opening. See, for example:
 
Upvote 0
Whether you need 'wApp.Visible = True' really depends on what you're doing in Word. I regularly use 'wApp.Visible = False' (or the equivalent thereof. Employing 'wApp.Visible = True' can be useful while your code isn't fully tested, though, and is essential if you want to view whatever document(s) you're opening. See, for example:
Thank you, will check out them tomorrow. Do you by the way how an app can be viewed, if its visibility is hiden? Where is tjis file? You can not see this at all? (i mean right click a word document and somehow reveal hidden documents or idk) So it will be unvisible for ever until i dont set it to visible?
 
Upvote 0
If Word is being run with 'wApp.Visible = False', the only way of accessing it through the user interface is by setting 'wApp.Visible = True'; otherwise, you can see it in Task Manager - which is useful if your macro crashes with an open document you can no longer access. Hiding Word or the document (as also demonstrated in some of the links) has no effect on the document's accessibility outside the macro.
 
Upvote 0
Solution
If Word is being run with 'wApp.Visible = False', the only way of accessing it through the user interface is by setting 'wApp.Visible = True'; otherwise, you can see it in Task Manager - which is useful if your macro crashes with an open document you can no longer access. Hiding Word or the document (as also demonstrated in some of the links) has no effect on the document's accessibility outside the macro.
Thank you very much!!! Great insights.
 
Upvote 0

Forum statistics

Threads
1,215,201
Messages
6,123,617
Members
449,109
Latest member
Sebas8956

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top