Results 1 to 15 of 15

VBA for opening certain file, NOT just a file location

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    250

    Question VBA for opening certain file, NOT just a file location

    I have a spread sheet with rollover hyperlinks to change cells certain colours when the mouse hovers over them. I also have a script which allows me to double click on a cell which makes it open a file location so the user can choose which (or multiple) files to open.

    however. when I try to add the actual file name on the end of the file destination it doesn't seem to accept it. my code is shown below. what am I doing wrong?

    I have attached the spread sheet and shown code below




    'Macro to apply to range of cells and open location files for multiple selection
    
    Private Sub Worksheet_BeforeDoubleClick(ByVal target As Range, Cancel As Boolean)
    
    Set t = target
    Set e6 = Range("e6")
    If Intersect(t, e6) Is Nothing Then Exit Sub
    Cancel = True
    ChDir "C:\Users\boymam\desktop"
      Which = Application.GetOpenFilename(MultiSelect:=True)
    If IsArray(Which) Then
     For I = 1 To UBound(Which)
     Workbooks.Open Which(I)
     Next
    End If
     End Sub
    when I try to add a file name after the "C:\users\boymam\desktop" It doesn't work, either im added wrong or the codes wrong? if someone could show me how to add the actual file id appreciate it,

    thanks
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Save as macro that specifies file type, file location and takes file name from three cells
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-13-2013, 10:09 PM
  2. Replies: 1
    Last Post: 10-01-2012, 11:46 PM
  3. Opening file message when opening a file from an http address
    By The_Real_MerlinXL in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2010, 12:33 PM
  4. opening a file from a remote location
    By Josh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2006, 05:10 PM
  5. [SOLVED] opening an excel file opens a duplicate file of the same file
    By skm in forum Excel General
    Replies: 1
    Last Post: 12-07-2005, 01:55 PM

Tags for this Thread

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