Command button


Posted by Brent R on May 03, 2001 10:43 AM

I'm trying to setup a command button that will open a Word document. Can this be done?
The first shortcut works "Sub shortcuts()". It opens the same data but as an excel worksheet.
The second shortcut doesn't work "Sub ExcelShortcuts()". All cases are correct.

Sub shortcuts()

ChDir "G:\public"
Workbooks.Open FileName:= _
"\\AFRICA\VOL1\USERS\YSADMIN\RODEN\public\Excel ShortCuts.xls"
ActiveWindow.WindowState = xlNormal
With ActiveWindow
.Width = 496.5
.Height = 440.25
End With
End Sub


Sub ExcelShortcuts()
'
ChDir "G:\public"
Word.Open FileName:= _
"\\AFRICA\VOL1\USERS\YSADMIN\RODEN\public\excel shortcuts.doc"
ActiveWindow.WindowState = xlNormal
With ActiveWindow
.Width = 496.5
.Height = 440.25
End With
End Sub

Thanks
Brent



Posted by Celia on May 07, 2001 8:03 AM


Brent
To open your Word Doc. try :-

CreateObject("Word.Application").Documents.Open("G:\public\AFRICA\VOL1\USERS\YSADMIN\RODEN\public\excel shortcuts.doc").Application.Visible = True

Celia