+ Reply to Thread
Results 1 to 6 of 6

Code required to open files - Excel,Word,Text,PDF

  1. #1
    Registered User
    Join Date
    04-16-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    57

    Code required to open files - Excel,Word,Text,PDF

    Hello,

    Hoping someone can help me out here.

    I have 3 columns -

    Column A has general file names, Column B has file names associated with files from Column A, and, Column C has path to all the files from Column B.

    I have a userform with 3 combobox and 1 command button.

    Data in Column A gets populated in 1st combobox and Column B in 02nd. Based on what is selected in 2nd combobox, 3rd combobox gets populated with data from Column C.

    Below is the code used to populate all 3 comboboxes -

    Please Login or Register  to view this content.
    I'm looking for a code to open files as per the path mentioned in the 3rd combobox When the command button is pressed.

    Have attached sample sheet.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Code required to open files - Excel,Word,Text,PDF

    this code for button open

    Please Login or Register  to view this content.
    Kind regards
    Leo


    Edit

    forget this one
    only good for excell
    Attached Files Attached Files
    Last edited by LeoTaxi; 12-03-2015 at 07:22 PM.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Code required to open files - Excel,Word,Text,PDF

    Try something like this...
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    04-16-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    57

    Re: Code required to open files - Excel,Word,Text,PDF

    Hello,

    Thanks for responding.

    LeoTaxi, code provided by you is only helpful in opening Excel files. It does not open remaining file types which is xlsb, Doc, Docx, Text and PDF.

    AlphaFrog, your code opens file formats xls,doc,docx and text. Currently I'm saving excel file in 2 formats - xls and xlsb. Request you to tweak the code so that it open xlsb file and PDF also.
    Last edited by bimmy80; 12-04-2015 at 12:41 AM.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Code required to open files - Excel,Word,Text,PDF

    Quote Originally Posted by bimmy80 View Post
    Hello,

    Thanks for responding.

    LeoTaxi, code provided by you is only helpful in opening Excel files. It does not open remaining file types which is xlsb, Doc, Docx, Text and PDF.

    AlphaFrog, your code opens file formats xls,doc,docx and text. Currently I'm saving excel file in 2 formats - xls and xlsb. Request you to tweak the code so that it open xlsb file and PDF also.
    You're welcome.

    It should open xlsb files. Did you try it? If yes, what if anything happened?

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Code required to open files - Excel,Word,Text,PDF

    This should open any file extension within your Window's File Associations.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA code to open many files, copy text, close file, paste text in second work
    By Bikeman in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 02-11-2014, 12:59 PM
  2. Macro to open files in word and paste into excel
    By iliauk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2013, 01:29 AM
  3. Replies: 13
    Last Post: 11-29-2012, 08:25 PM
  4. VBA Code to open text files and copy information over to an excel sheet
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2012, 12:18 PM
  5. [SOLVED] Excel and Word will not open saved files
    By Flannagan in forum Excel General
    Replies: 2
    Last Post: 04-26-2006, 04:30 AM
  6. [SOLVED] Can't open files in Excel or Word
    By rortiz in forum Excel General
    Replies: 2
    Last Post: 04-18-2006, 08:35 PM
  7. Why won't my Word open files in Excel?
    By p-oedkc in forum Excel General
    Replies: 1
    Last Post: 02-14-2006, 06:10 AM
  8. Replies: 1
    Last Post: 01-12-2006, 04:35 PM

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