Consulting

Results 1 to 4 of 4

Thread: Specify Export Path

  1. #1
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location

    Specify Export Path

    I thought I had this right, but I was wrong.

    I want to export a module, but I want to specify exactly where I wanted exported to i.e. Desktop or My Documents or wherever...How?

    The export procedure is

    Sub ExportModule()
    Application.VBE.ActiveVBProject.VBComponents(1).Export ("Version101.bas")
    End Sub
    (Dunno why it's showing in preview as Ex port)

    TIA
    John
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    I'll let Mark know about the word Export being splitted for some reason.

    You just need to specify the path with the file name.

    Option Explicit
     
    Sub ExportModule()
    Application.VBE.ActiveVBProject.VBComponents(1).Export _
        ("c:\Version101.bas")
    End Sub

  3. #3
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Thanx Jake,

    Works a treat.

    (I specified the path differently for import and it worked so I assumed it'd work for export as well, but it don't)
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  4. #4
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    You're Welcome

    Take Care

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •