Consulting

Results 1 to 2 of 2

Thread: Open Excel Spreadsheet

  1. #1
    VBAX Regular
    Joined
    Feb 2011
    Posts
    11
    Location

    Open Excel Spreadsheet

    Hi I have defined a filepath in a userform.

    currently set as "cfsource"

    I am now trying to use this to open the relating excel spreadsheet to copy info over.

    I have tried many variations but none seem to launch excel or the spreadsheet which I have also tried as its path "C:\..."

    Any help would be much appreciated.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Set xlApp = CreateObject("Excel.Application")
    Set xlWB = xlApp.Workbooks.Open(cfsource)

    'xlWB is now an Excel workbook object that you can manipulate
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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