none
Changing file in an Excel Macro RRS feed

  • Question

  • Hello
    I'm writing an Excel macro that uses diferent Excel files.
    This sentence brings an error:  Windows(name(I)).Activate
    How can I use variables to provide the Excel file?
    Thanks
    Friday, July 7, 2017 2:23 PM

All replies

  • If you are using the Macro editor within Excel then you are writing VBA, not VB.Net.

    I will move this thread to a VBA forum.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Friday, July 7, 2017 2:46 PM
  • I'm writing an Excel macro that uses diferent Excel files.
    This sentence brings an error:  Windows(name(I)).Activate
    How can I use variables to provide the Excel file?
    Thanks
    Do you want to open different Excel file in VBA? If so, code like this.
    Workbooks.Open "file name with full path"

    Ashidacchi

    Saturday, July 8, 2017 12:40 AM