Consulting

Results 1 to 3 of 3

Thread: Solved: What did I do wrong?

  1. #1
    VBAX Tutor
    Joined
    Dec 2008
    Posts
    244
    Location

    Solved: What did I do wrong?

    My worksheet colum a contains the file path to various file.
    i want to open the path that is on cell A3. what did I do wrong.


    [vba]
    Sub test_open_file()
    Dim testwkb As Workbook, primewkb As Workbook
    Set primewkb = ThisWorkbook
    set testwkb = application.Workbooks.Open(?primewkb.Worksheets("sheet1").range("A3").Value )

    End Sub
    [/vba]

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Try without the question mark
    (?primewkb
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Tutor
    Joined
    Dec 2008
    Posts
    244
    Location
    thanks.

Posting Permissions

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