Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default create a folder

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default create a folder

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default create a folder

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default create a folder

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k[_40_] Excel Programming 6 August 11th 06 08:41 PM
Create Folder Steph[_3_] Excel Programming 2 October 19th 04 11:11 PM
Create New Folder JMay Excel Programming 6 June 9th 04 02:14 PM
Create Folder and Text File in folder Todd Huttentsine Excel Programming 2 April 29th 04 03:41 PM
Create Folder / Copy Folder / Replace Murray Outtrim[_2_] Excel Programming 0 February 24th 04 06:40 PM


All times are GMT +1. The time now is 10:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"