Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Open Word Document from Excel Userform

Happy New Year!

What is going on?

My scenario:
I have an Excel Userform with 2 command buttons.
Commandbutton 1: opens an excel file (this works)
Commandbutton 2: NEEDS to open a word document (problem)

How can I open a word document from this Excel Userform?
Does Excel open Excel related files only?

This is the code to open the Excel file: (this works)
Private Sub cmd1_Click()
ChDir "J:\Myrna"
Workbooks.Open Filename:="J:\Myrna\openexcel-1.xls"
End Sub

This is the code to open the word file: (problem)
Private Sub cmd2_Click()
ChDir "J:\Myrna"
Workbooks.Open Filename:="J:\Myrna\openword-1.doc"
End Sub
ERROR MESSAGE: runtime error: file format is not valid


Thanks in advacnce for your help & have a happy day!



*** Sent via Developersdex http://www.developersdex.com ***
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Open Word Document from Excel Userform

Thanks much for your help!
It works very smooth.

happy day!!

*** Sent via Developersdex http://www.developersdex.com ***
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
Open A Word Document from Excel roadkill Excel Programming 4 November 4th 05 10:15 PM
open word document in excel spaceslime Excel Discussion (Misc queries) 1 August 13th 05 03:15 PM
what happens if I open an excel document in word? Emily Excel Discussion (Misc queries) 3 April 2nd 05 10:49 AM
Open a word document in excel Michael[_29_] Excel Programming 1 March 2nd 04 09:58 PM
open a word document in excel Herb[_4_] Excel Programming 1 August 9th 03 01:36 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"