![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: John G
Posts: 62
|
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 | |
|
Guest
Posts: n/a
|
Quote:
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 | ||
|
Guest
Posts: n/a
|
Quote:
|
||
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|