• VB Code not changing directory (Excel 2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » VB Code not changing directory (Excel 2003)

    Author
    Topic
    #450772

    I have the following code:
    ChDir “C:dds_txt”
    Workbooks.Open “Email List.xls”, , N, , , , Y

    When I am located any where on the network, this seems to work – except when I am logged into my personal drive (H:/). In this case, the change doesn’t work and I get the error “Email List.xls Not Found”. Is there something I should add to the “CHDIR” command so it works from other drives?

    Viewing 0 reply threads
    Author
    Replies
    • #1108225

      You can use

      Workbooks.Open “C:dds_txtEmail List.xls”

      Or use

      ChDrive “C:”
      ChDir “C:dds_txt”
      Workbooks.Open “Email List.xls”

      • #1108227

        Many thanks. So you know, I got an email from someone that said, “I have decided that Hans is not just one person.” I don’t know if you are (I can easily believe that there must be more than 1 of you), but whoever you are, I am always grateful. Thanks.

    Viewing 0 reply threads
    Reply To: VB Code not changing directory (Excel 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: