Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
creating new folder while saving document
I am trying to create a command, that when clicked will print out a boo
twice and save it. It needs to create a new folder in the directory. The Name of the folder, needs to be what is in Text Box 1. This i what I currently have. Can someone point me in the right direction? Private Sub CommandButton1_Click() Unload Me ActiveWorkbook.PrintOut ChDir "\\Pkcfp009\Mait_e&d\NewHireDocumentation\La Forms\Transition to Success\" Dim NameOFile$ NameOFile = TextBox2.Text ThisWorkbook.SaveAs NameOFile & ".xls" ChDir "%USERPROFILE%\Transition to Success Plans\" Dim NameOFile$ NameOFile = TextBox2.Text ThisWorkbook.SaveAs NameOFile & ".xls" End Su -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
creating new folder while saving document
Also,
When it saves it, it is not saving the actual excel workbook. It i renaming the userform and saving that. How do I tell it to save th file that it was sending the info to. I've tried calling up th workbook then saving it, but it still doesnt work -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
creating new folder while saving document
On Thu, 17 Jun 2004 21:49:41 -0500, dok112
wrote: I am trying to create a command, that when clicked will print out a book twice and save it. It needs to create a new folder in the directory. The Name of the folder, needs to be what is in Text Box 1. This is what I currently have. Can someone point me in the right direction? Private Sub CommandButton1_Click() Unload Me ActiveWorkbook.PrintOut ChDir "\\Pkcfp009\Mait_e&d\NewHireDocumentation\Lab Forms\Transition to Success\" Dim NameOFile$ NameOFile = TextBox2.Text ThisWorkbook.SaveAs NameOFile & ".xls" ChDir "%USERPROFILE%\Transition to Success Plans\" Dim NameOFile$ NameOFile = TextBox2.Text ThisWorkbook.SaveAs NameOFile & ".xls" End Sub Okay, so, TextBox1 is the new folder, and TextBox2 is a new filename? How about this: newFolder$ = "full\path\to\new\folder\" & TextBox1.Text MkDir newFolder$ newFile$ = newFolder$ & "\" & TextBox2.Text & ".xls" ThisWorkbook.SaveAs newFile$ -- auric underscore underscore at hotmail dot com ***** Sweet Virgin Mary's tampon! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
creating new folder while saving document
This works great!! Only problem, it is saving the userform file, no
the actual document. Basically, I am using a userform to inser information multiple times in a .xls file. When it's done, I need t save it the file (TextBox2.Text) and the filename (TextBox1.Text). Bu I need to save the document, not the userfile. How do I do this -- Message posted from http://www.ExcelForum.com |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
creating new folder while saving document
On Mon, 21 Jun 2004 09:40:24 -0500, dok112
wrote: This works great!! Only problem, it is saving the userform file, not the actual document. Basically, I am using a userform to insert information multiple times in a .xls file. When it's done, I need to save it the file (TextBox2.Text) and the filename (TextBox1.Text). But I need to save the document, not the userfile. How do I do this? So, instead of giving you a .xls file, you're getting a .frm file? If so, that's... weird... I didn't know you could do that... As for solving that, beats the heck outta me. -- auric underscore underscore at hotmail dot com ***** Caffeine makes the world go round. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving a workbook by creating a folder & subfolder | Excel Worksheet Functions | |||
document information from folder | Excel Discussion (Misc queries) | |||
Templates - saving in specified folder | Excel Discussion (Misc queries) | |||
Saving file to a specific folder | Excel Discussion (Misc queries) | |||
Specify a folder for saving to?!?! | Excel Programming |