ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Word from Excel (https://www.excelbanter.com/excel-programming/387661-open-word-excel.html)

JT

Open Word from Excel
 
In my workbook, I have one sheet with high level instructions for the users.
On that sheet. there is a button to open a Word Document with more detailed
instructions for the user to read. It works fairly well and opens quickly.

The issue is once the Word document is open, it is not useable, almost like
it is frozen for 5 to 10 seconds. Once the initial "frozen" period is over,
the user is able to scroll or move through the document.

The code for this button is below:

Dim WApp As Word.Application
Dim WDoc As Word.Document
Set WApp = CreateObject("Word.Application")

Dim ThisPath As String
Dim ThisFile As String

ThisPath = "\\Vs999\public\Accounts\Originals\"
ThisFile = "Instructions - Admin Office.doc"

Set WDoc = WApp.Documents.Open(ThisPath & ThisFile)

WApp.Visible = True

Set WApp = Nothing
Set WDoc = Nothing

Any suggestions or help you can provide to resolve / reduce that waiting
period would be greatly resolved. This the first time I have tried to open a
Word document from Excel. Thanks again......

--
JT

Tom Ogilvy

Open Word from Excel
 
I haven't had that type of experience - although opening anything via
automation incurs some overhead as the application is stared. If you open
the document manually, does it open instantly?

things I could think of would be Norton Anti-Virus running a scan of the
document.

or the document is large and/or has links that have to be updated - so it
naturally takes a while to open.

From your description, it appears the document is visible on the screen
during this period, so I assume you are not talking about the overhead of
starting up word.


--
Regards,
Tom Ogilvy



"JT" wrote:

In my workbook, I have one sheet with high level instructions for the users.
On that sheet. there is a button to open a Word Document with more detailed
instructions for the user to read. It works fairly well and opens quickly.

The issue is once the Word document is open, it is not useable, almost like
it is frozen for 5 to 10 seconds. Once the initial "frozen" period is over,
the user is able to scroll or move through the document.

The code for this button is below:

Dim WApp As Word.Application
Dim WDoc As Word.Document
Set WApp = CreateObject("Word.Application")

Dim ThisPath As String
Dim ThisFile As String

ThisPath = "\\Vs999\public\Accounts\Originals\"
ThisFile = "Instructions - Admin Office.doc"

Set WDoc = WApp.Documents.Open(ThisPath & ThisFile)

WApp.Visible = True

Set WApp = Nothing
Set WDoc = Nothing

Any suggestions or help you can provide to resolve / reduce that waiting
period would be greatly resolved. This the first time I have tried to open a
Word document from Excel. Thanks again......

--
JT


Ed

Open Word from Excel
 
JT -

I think you might be mixing early and late binding, which could be
causing some problems. You might want to take a look at
http://word.mvps.org/FAQs/InterDev/E...ateBinding.htm
and
http://word.mvps.org/FAQs/InterDev/C...WordFromXL.htm

Ed

On Apr 18, 9:24 am, JT wrote:
In my workbook, I have one sheet with high level instructions for the users.
On that sheet. there is a button to open a Word Document with more detailed
instructions for the user to read. It works fairly well and opens quickly.

The issue is once the Word document is open, it is not useable, almost like
it is frozen for 5 to 10 seconds. Once the initial "frozen" period is over,
the user is able to scroll or move through the document.

The code for this button is below:

Dim WApp As Word.Application
Dim WDoc As Word.Document
Set WApp = CreateObject("Word.Application")

Dim ThisPath As String
Dim ThisFile As String

ThisPath = "\\Vs999\public\Accounts\Originals\"
ThisFile = "Instructions - Admin Office.doc"

Set WDoc = WApp.Documents.Open(ThisPath & ThisFile)

WApp.Visible = True

Set WApp = Nothing
Set WDoc = Nothing

Any suggestions or help you can provide to resolve / reduce that waiting
period would be greatly resolved. This the first time I have tried to open a
Word document from Excel. Thanks again......

--
JT




NickHK

Open Word from Excel
 
Whilst it may not have any effect on the freeze, as you only require the
document to be shown, drop the COM stuff.

Dim ThisPath As String
Dim ThisFile As String

ThisPath = "\\Vs999\public\Accounts\Originals\"
ThisFile = "Instructions - Admin Office.doc"

ThisWorkbook.FollowHyperlink ThisPath & ThisFile, , True

NickHK

"JT" wrote in message
...
In my workbook, I have one sheet with high level instructions for the

users.
On that sheet. there is a button to open a Word Document with more

detailed
instructions for the user to read. It works fairly well and opens

quickly.

The issue is once the Word document is open, it is not useable, almost

like
it is frozen for 5 to 10 seconds. Once the initial "frozen" period is

over,
the user is able to scroll or move through the document.

The code for this button is below:

Dim WApp As Word.Application
Dim WDoc As Word.Document
Set WApp = CreateObject("Word.Application")

Dim ThisPath As String
Dim ThisFile As String

ThisPath = "\\Vs999\public\Accounts\Originals\"
ThisFile = "Instructions - Admin Office.doc"

Set WDoc = WApp.Documents.Open(ThisPath & ThisFile)

WApp.Visible = True

Set WApp = Nothing
Set WDoc = Nothing

Any suggestions or help you can provide to resolve / reduce that waiting
period would be greatly resolved. This the first time I have tried to

open a
Word document from Excel. Thanks again......

--
JT





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

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