+ Reply to Thread
Results 1 to 3 of 3

to open a pdf file from excel

  1. #1
    bigdaddy3
    Guest

    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. #2
    chijanzen
    Guest

    RE: 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. #3
    bigdaddy3
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1