Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, This should be very simple, but it doesn't work for some reason! I'm trying to open a file name when the user clicks on a command button and here is the code I'm using: Private Sub CommandButton1_Click() Documents.Open ("C:\Test.doc") End Sub I've also tried using Application.GetOpenFilename, but still no joy. Please help. Many thanks, Anar -- anar_baku ------------------------------------------------------------------------ anar_baku's Profile: http://www.excelforum.com/member.php...o&userid=18259 View this thread: http://www.excelforum.com/showthread...hreadid=540260 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Workbooks.Open Filename:="R:\xxx\yyy.xls"
Hope it helps, Ozgur "anar_baku" wrote: Hi, This should be very simple, but it doesn't work for some reason! I'm trying to open a file name when the user clicks on a command button and here is the code I'm using: Private Sub CommandButton1_Click() Documents.Open ("C:\Test.doc") End Sub I've also tried using Application.GetOpenFilename, but still no joy. Please help. Many thanks, Anar -- anar_baku ------------------------------------------------------------------------ anar_baku's Profile: http://www.excelforum.com/member.php...o&userid=18259 View this thread: http://www.excelforum.com/showthread...hreadid=540260 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This works fine for files that can open in Excel, but not for those that can't. I'm trying to open .doc/.pdf files. Any alternatives? Ozgur Pars Wrote: Workbooks.Open Filename:="R:\xxx\yyy.xls" Hope it helps, Ozgur "anar_baku" wrote: Hi, This should be very simple, but it doesn't work for some reason! I'm trying to open a file name when the user clicks on a command button and here is the code I'm using: Private Sub CommandButton1_Click() Documents.Open ("C:\Test.doc") End Sub I've also tried using Application.GetOpenFilename, but still no joy. Please help. Many thanks, Anar -- anar_baku ------------------------------------------------------------------------ anar_baku's Profile: http://www.excelforum.com/member.php...o&userid=18259 View this thread: http://www.excelforum.com/showthread...hreadid=540260 -- anar_baku ------------------------------------------------------------------------ anar_baku's Profile: http://www.excelforum.com/member.php...o&userid=18259 View this thread: http://www.excelforum.com/showthread...hreadid=540260 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() In case anyone needs it, I've now found a simple way: ActiveWorkbook.FollowHyperlink Address:="C:\File.xxx", NewWindow:=True -- anar_baku ------------------------------------------------------------------------ anar_baku's Profile: http://www.excelforum.com/member.php...o&userid=18259 View this thread: http://www.excelforum.com/showthread...hreadid=540260 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For word documents you can use:
Documents.Open FileName:="c:\xxx.doc" or alternatively: Sub AAA() Dim App As Application Dim W As Document Set App = Word.Application Set W = app.Documents.Open("c:\xxx.doc") End Sub Just call AAA in your code... "anar_baku" wrote: This works fine for files that can open in Excel, but not for those that can't. I'm trying to open .doc/.pdf files. Any alternatives? Ozgur Pars Wrote: Workbooks.Open Filename:="R:\xxx\yyy.xls" Hope it helps, Ozgur "anar_baku" wrote: Hi, This should be very simple, but it doesn't work for some reason! I'm trying to open a file name when the user clicks on a command button and here is the code I'm using: Private Sub CommandButton1_Click() Documents.Open ("C:\Test.doc") End Sub I've also tried using Application.GetOpenFilename, but still no joy. Please help. Many thanks, Anar -- anar_baku ------------------------------------------------------------------------ anar_baku's Profile: http://www.excelforum.com/member.php...o&userid=18259 View this thread: http://www.excelforum.com/showthread...hreadid=540260 -- anar_baku ------------------------------------------------------------------------ anar_baku's Profile: http://www.excelforum.com/member.php...o&userid=18259 View this thread: http://www.excelforum.com/showthread...hreadid=540260 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
document in xls and cannot open without a password. How to open? | Excel Discussion (Misc queries) | |||
I forgot my password to open an excel document, how do I open it? | Excel Discussion (Misc queries) | |||
my excel document won't open unless i go file, then open | Excel Discussion (Misc queries) | |||
why must I open an Excel document twice to get it to open after . | Excel Discussion (Misc queries) | |||
When I open excel document it always ask if I want to open it in . | Excel Discussion (Misc queries) |