Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i got a code to "save as" and overright a workbook. what i need is for it
to check if C:\pswanie\inventry does exist. if it does then the code runs. if not i need to create that folder and insert inventry.xls |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On error resume next
mkdir "C:\pswanie" On Error goto 0 -- Regards, Tom Ogilvy "pswanie" wrote: i got a code to "save as" and overright a workbook. what i need is for it to check if C:\pswanie\inventry does exist. if it does then the code runs. if not i need to create that folder and insert inventry.xls |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
just paste that? or how do i go about? this my macro....
Windows("editINVENTRY.xls").Activate Sheets("inv 1st page").Select ActiveSheet.Unprotect Workbooks.Open Filename:= _ "C:\maykent\inventry\inventry.xls" Sheets("inv 1st page").Select Range("B14:T14").Select Selection.Copy Windows("editINVENTRY.xls").Activate Range("B14:T14").Select ActiveSheet.Paste etc...... ending with.... ChDir "C:\maykent\inventry" Application.DisplayAlerts = False ActiveWorkbook.SaveAs Filename:="C:\maykent\inventry\INVENTRY.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False Application.DisplayAlerts = True Application.Quit "Tom Ogilvy" wrote: On error resume next mkdir "C:\pswanie" On Error goto 0 -- Regards, Tom Ogilvy "pswanie" wrote: i got a code to "save as" and overright a workbook. what i need is for it to check if C:\pswanie\inventry does exist. if it does then the code runs. if not i need to create that folder and insert inventry.xls |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Error Resume Next
mkdir "C:\maykent" mkdir "C:\maykent\inventry" On Error goto 0 ChDir "C:\maykent\inventry" Application.DisplayAlerts = False ActiveWorkbook.SaveAs Filename:="C:\maykent\inventry\INVENTRY.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False Application.DisplayAlerts = True Application.Quit -- Regards, Tom Ogilvy "pswanie" wrote: just paste that? or how do i go about? this my macro.... Windows("editINVENTRY.xls").Activate Sheets("inv 1st page").Select ActiveSheet.Unprotect Workbooks.Open Filename:= _ "C:\maykent\inventry\inventry.xls" Sheets("inv 1st page").Select Range("B14:T14").Select Selection.Copy Windows("editINVENTRY.xls").Activate Range("B14:T14").Select ActiveSheet.Paste etc...... ending with.... ChDir "C:\maykent\inventry" Application.DisplayAlerts = False ActiveWorkbook.SaveAs Filename:="C:\maykent\inventry\INVENTRY.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False Application.DisplayAlerts = True Application.Quit "Tom Ogilvy" wrote: On error resume next mkdir "C:\pswanie" On Error goto 0 -- Regards, Tom Ogilvy "pswanie" wrote: i got a code to "save as" and overright a workbook. what i need is for it to check if C:\pswanie\inventry does exist. if it does then the code runs. if not i need to create that folder and insert inventry.xls |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save file in a new folder, but create folder only if folder doesn't already exist? | Excel Programming | |||
Create Folder | Excel Programming | |||
Create New Folder | Excel Programming | |||
Create Folder and Text File in folder | Excel Programming | |||
Create Folder / Copy Folder / Replace | Excel Programming |