Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: make directory & open as

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    John G
    Posts
    62
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I would like to use vba code to make a new path and file name for an existing workbook. What syntax do I use to create the new folder when I'm trying to save the workbook?

    I also would like to open a new workbook as "xfile.xls". How would I code that?

    Thanks,

    John

  2. #2
    Guest

    Default

    On 2002-02-17 17:45, jgoulart wrote:
    I would like to use vba code to make a new path and file name for an existing workbook. What syntax do I use to create the new folder when I'm trying to save the workbook?

    I also would like to open a new workbook as "xfile.xls". How would I code that?

    Thanks,

    John

    Hi John
    Syntax to make a new directory;
    From MSHELP:MkDir Statement Example
    This example uses the MkDir statement to create a directory or folder. If the drive is not specified, the new directory or folder is created on the current drive.

    MkDir "MYDIR" ' Make new directory or folder.

    eg.MkDir "C:NewFolderXlfiles" OR
    MkDir "NewFolderXlFiles" if C: is last Dir.

    Then just reference the new dir to saveto;

    eg Activeworkbook.save "C:NewFolderXlfilesxfile.xls"


    Ivan


  3. #3
    Guest

    Default

    On 2002-02-17 18:07, Anonymous wrote:
    On 2002-02-17 17:45, jgoulart wrote:
    I would like to use vba code to make a new path and file name for an existing workbook. What syntax do I use to create the new folder when I'm trying to save the workbook?

    I also would like to open a new workbook as "xfile.xls". How would I code that?

    Thanks,

    John

    Hi John
    Syntax to make a new directory;
    From MSHELP:MkDir Statement Example
    This example uses the MkDir statement to create a directory or folder. If the drive is not specified, the new directory or folder is created on the current drive.

    MkDir "MYDIR" ' Make new directory or folder.

    eg.MkDir "C:NewFolderXlfiles" OR
    MkDir "NewFolderXlFiles" if C: is last Dir.

    Then just reference the new dir to saveto;

    eg Activeworkbook.save "C:NewFolderXlfilesxfile.xls"


    Ivan

    PS Post again if unsure

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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