Excel asks me if I want to open again the file RRS feed

  • Question

  • In VBA I have a radio button. When I click one of the radio button, it opens a excel file.

    Code is:

     OnsetStats.Checked = False

    But, after the file opens and automatically asks me to add the .txt to import (through a macro), Excel always asks me if I want to open again that file Stats.xlsm.. I would like not to have this error every time.

    Thank you.

    Wednesday, December 28, 2016 2:16 PM

All replies

  • Is it possible there are multiple references to (1) the Stats.xlsm file in your workbook's code as it executes (a find will do this, or course); or (2) the sub/function code containing the Process.Start statement above is called from another event or another code segment; or (3) the stats.xlsm workbook also contains an open statement to itself?

    Typically I use the Workbooks.Open statement to open a workbook from within vba, so that may be another statement to search (find) your code. In fact, I've only used the Process.Start statement in stuff & not vba.


    • Edited by MainSleuth Wednesday, December 28, 2016 11:34 PM
    Wednesday, December 28, 2016 11:32 PM
  • Hi

    I agree with MainSleuth. Normally, we would use Workbooks.Open to open an Excel file.

    According to your code, I think you are developing with VB.NET.

    How do you set your RadioButtonWhat Sub do you write these code to open the workbook? Is there any other code to close the file?

    I suggest you use a checkbox to open/close the file.

    If you want to use RadioButton, I suggest you add two. One to open and the other to close the file. 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Thursday, December 29, 2016 6:33 AM