creating folder

  • Thread starter Thread starter Lawson
  • Start date Start date
L

Lawson

i want my program to save in a certain area of our
server, but how do i make it create the final folder? (in
case it matters the program is below)

Private Sub CommandButton11_Click()
If Range("k265") = 1 Then
If Range("h251") = "Job #" Then Exit Sub
ActiveWorkbook.SaveAs Filename:="\\Cpi-server-1
\estimate\Quotes\EST" & Range("q262") & "000\EST" & Range
("q262") & Range("q263") & "00\" & Range("h251")
& ".xls", FileFormat:=xlNormal, Password:="",
WriteResPassword:="", ReadOnlyRecommended:=False,
CreateBackup:=False
Else
'For Each w In Application.Workbooks: w.Activate:
If Range("q297") = 0 Then
MsgBox "This file is not linked.": Exit Sub
Else
If Range("q292") = 1 Then
MsgBox ""
ActiveWorkbook.SaveAs Filename:="\\AAA-server-1
\estimate\Quotes\EST" & Range("q262") & "000\EST" & Range
("q262") & Range("q263") & "00\" & Range("q261") & "\" &
Range("h251") & ".xls", FileFormat:=xlNormal,
Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, CreateBackup:=False
Else
ActiveWorkbook.SaveAs Filename:="\\AAA-server-1
\estimate\Quotes\EST" & Range("q262") & "000\EST" & Range
("q262") & Range("q263") & "00\" & Range("h251")
& ".xls", FileFormat:=xlNormal, Password:="",
WriteResPassword:="", ReadOnlyRecommended:=False,
CreateBackup:=False
End If
End If
'Next w
End If
 
Lawson said:
i want my program to save in a certain area of our
server, but how do i make it create the final folder?

See MkDir in VBA help.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multi save 1
Simplify save code 11
File Searching 1
Macro to save a workbook 1
Hiding an Excel file using VBA 1
Saving a workbook to an iKnow portal 2
Save with ref. to cell A1 2
Save As File Format 1

Back
Top