+ Reply to Thread
Results 1 to 7 of 7

Open a Excel file selecting a option in Combobox

  1. #1
    Registered User
    Join Date
    10-04-2018
    Location
    Cancun, Mexico
    MS-Off Ver
    2013 & 2016 32b
    Posts
    78

    Open a Excel file selecting a option in Combobox

    Hello

    I need help guiding me with a Userfom i have .
    IŽd like to select a mouth in a combobox that opens a excel file after checking the file is not in use , what i have is this:
    Please Login or Register  to view this content.
    but the code does nothing, it works only when i aply the code on a comand botton.
    is there a different case using it with a combobox ?
    thanks

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Open a Excel file selecting a option in Combobox

    Code can be simplified but I see no reason why it wouldn't work with the Change-event.

    The only thing I can think of is that you clicked on the name that was selected before. You need to select another value then the one being displayed in the CB.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    10-04-2018
    Location
    Cancun, Mexico
    MS-Off Ver
    2013 & 2016 32b
    Posts
    78

    Re: Open a Excel file selecting a option in Combobox

    thank you

    it works fine now ...also thank you to trim my code since it will be usefull when file directory changes to modify quickly

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Open a Excel file selecting a option in Combobox

    you're welcome and thanks for rep+.

  5. #5
    Registered User
    Join Date
    10-04-2018
    Location
    Cancun, Mexico
    MS-Off Ver
    2013 & 2016 32b
    Posts
    78

    Re: Open a Excel file selecting a option in Combobox

    sorry

    i just find out that when the file is alrady open instad to show form YAESTAABIERTO.Show and close the workbook
    excel still would opend it as a copy and does not show the YAESTAABIERTO.Show


  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Open a Excel file selecting a option in Combobox

    Is PLATINUM the userform where the CB is in ?

    Try moving the Unload to the end of the code.

    What does your IsFileOpen code look like ?

  7. #7
    Registered User
    Join Date
    10-04-2018
    Location
    Cancun, Mexico
    MS-Off Ver
    2013 & 2016 32b
    Posts
    78

    Re: Open a Excel file selecting a option in Combobox

    it is working perfect moving the unload to the end of the code

    thank you again

+ 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] I need VBA code to make each combobox option on a userform open an excel workbook ...
    By Jalica in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-15-2016, 02:57 PM
  2. Open With... Excel not an option for an Access file?
    By CWatsonJr in forum Excel General
    Replies: 4
    Last Post: 11-17-2015, 12:30 AM
  3. Replies: 1
    Last Post: 11-07-2014, 01:21 PM
  4. Replies: 0
    Last Post: 07-18-2012, 09:45 AM
  5. password to open Excel file option does not exist
    By SabrinaN in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-22-2006, 11:00 PM
  6. Selecting AutoFilter option based on ComboBox value
    By clmarquez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2005, 09:24 PM
  7. Get data from ext. file when i choose an option from combobox
    By hmoner in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-17-2005, 01:16 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