Open Word from Excel

chef

Well-known Member
Joined
Jul 10, 2002
Messages
610
Office Version
  1. 365
  2. 2016
Hi,

is it possible to open a word document from excel ?

I have text in G1,sheet2 with "staff record"..
in cell A1 I have a staff record no eg T123456

I have a series of staff records in a folder g/public/chef/staffrec, all based on unique staff number eg T123456.doc etc

I want to be able to click on "staff record" or a button on sheet2 and open up the staff file from word?

is this possible..

any help appreciated
many thanks
ian
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
thanks..


my apoogies for using mr excel forum to obtain help and apology for obviously putting you out..

i can of course google and note your words of advice with my time

I have often found most people here more than helpful to nudge in right direction. why i come here.

tend to find if nothing constructive to say is to actually say nothing.
 
Upvote 0
My aim is that you now spend time applying the code I pointed you to. And to learn from it...

If you speak about constructive or not, yes it is constructive to show good code rather than reinventing the wheel.
 
Upvote 0
Try like this. In the VBE, in Tools > References tick Word Object library.

Change the path in red to suit.

For reasons I cannot fathom this opens the doc minimized to the taskbar. But as I said in your other thread, this is not my forte.

Rich (BB code):
Sub OpenWord()
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim wdFileName As String
wdFileName = "C:\example\" & Sheets("Sheet2").Range("A1").Value & ".doc"
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
wrdApp.WindowState = wdWindowStateMaximize
Set wrdDoc = wrdApp.Documents.Open(wdFileName)
End Sub
 
Upvote 0
Peter,

thank you for taking the time to try and help. I will try this at work tomorrow. This is more helpful and constructive advice.

Im not very good with vb and cant always fathom the vb logic and was looking for a quick solution rather than soundbites over someones aims or what I do with my time or learning ambitions.
Lazy, maybe and apols for that, but as I'm so busy was looking for a quick fix..thought that why mr excel was so helpful.

Appreciate your efforts to help Peter..no worries if I cant get this to work.

Your previous help was brilliant and very helpful to my dept.

As say, i sometimes need help, not lectures.

regards
ian
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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