Results 1 to 3 of 3
  1. #1
    clebergyn is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Dec 2012
    Location
    Brazil
    Posts
    48

    To open a file of the Excel using code VBA, but using a path?

    pat= Application.CurrentProject.path & "\Serviços-Materiais-" &
    Forms![Orçamento]![numprojeto]


    call shell(pat) or call shell(pat &".xls") it does not do right
    how to do to open a file of the excel, of easier way?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Try:
    Shell "Excel.exe " & pat, vbNormalFocus

    This article shows another method for opening files: http://allenbrowne.com/func-GoHyperlink.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    clebergyn is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Dec 2012
    Location
    Brazil
    Posts
    48
    ok, it is correct, very much thank you!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. to open Exported Excel File
    By waqas in forum Programming
    Replies: 3
    Last Post: 10-16-2011, 12:33 PM
  2. Open excel file in access
    By shanky365 in forum Access
    Replies: 1
    Last Post: 09-11-2011, 03:05 PM
  3. Excel code not working with Excel open
    By jgelpi16 in forum Programming
    Replies: 1
    Last Post: 07-11-2011, 12:12 PM
  4. Replies: 1
    Last Post: 01-06-2011, 11:23 AM
  5. How to open a word/excel/other file in vba
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-28-2010, 10:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums