Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default to open a pdf file from excel

With the code below i can open adobe acrobat 7 from within excel with a macro
but what i want to do is open an adobe pdf file from my documents folder i
added the code in brackets , adobe opened but said file not found. Any help
appreciated

Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe ( C:\Documents
& Settings\My Name\My Documents\MyFile.pdf)",vbNormalFocus

--
BD3
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default to open a pdf file from excel

bigdaddy3:

try, ShellExecute API Function

Const SW_SHOW = 5
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub test()
Filename = "C:\Documents & Settings\My Name\My Documents\MyFile.pdf"
ShellExecute 0, "open", Filename, "", "", SW_SHOW
End Sub

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"bigdaddy3" wrote:

With the code below i can open adobe acrobat 7 from within excel with a macro
but what i want to do is open an adobe pdf file from my documents folder i
added the code in brackets , adobe opened but said file not found. Any help
appreciated

Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe ( C:\Documents
& Settings\My Name\My Documents\MyFile.pdf)",vbNormalFocus

--
BD3

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default to open a pdf file from excel

tried that nothing happened
--
BD3


"chijanzen" wrote:

bigdaddy3:

try, ShellExecute API Function

Const SW_SHOW = 5
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub test()
Filename = "C:\Documents & Settings\My Name\My Documents\MyFile.pdf"
ShellExecute 0, "open", Filename, "", "", SW_SHOW
End Sub

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"bigdaddy3" wrote:

With the code below i can open adobe acrobat 7 from within excel with a macro
but what i want to do is open an adobe pdf file from my documents folder i
added the code in brackets , adobe opened but said file not found. Any help
appreciated

Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe ( C:\Documents
& Settings\My Name\My Documents\MyFile.pdf)",vbNormalFocus

--
BD3

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
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
EXCEL wont open from Explorer, must open EXCEL then find file wludwick Excel Discussion (Misc queries) 4 September 7th 06 08:06 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Open email windows can't open, excel shreadsheet file .xls ? skiz Excel Discussion (Misc queries) 0 October 2nd 05 07:03 PM
How do I stop Excel from closing the open file each time I open a. Welsin Setting up and Configuration of Excel 3 January 8th 05 11:16 PM


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

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

About Us

"It's about Microsoft Excel"