473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Creating a folder inside a already existing folder

I am currently running a macro to design my documents but my code is written to overwrite the existing file and save it in the same folder without any confirmation. I have 30 such unformatted files in the folder. But now I want to create a subfolder inside the parent folder to store all the formatted sheets and not overwrite them.

For e.g. if the location is "C:\Temp\File1.xls", then the code should automatically detect the file path and create a folder Formatted i.e. C:\Temp\Formatted (if it doesnt exist) and save all the files in that folder.

Please note that the code should take the file path automatically because the file path is different every-time for each file but the subfolder created name should be "Formatted".

Thanks in advance...
Anup
Sep 21 '09 #1
1 1830
smartchap
236 100+
Use fso for this. First store path of opened file in a variable, say OPath, then while saving (for surity) check if the file already exists there, Check if folder 'Formatted' exists in OPath or not, if not then create a new folder named 'Formatted' in the OPath otherwise save the file in the New Path as
NPath = OPath & "\Formatted"
Sep 25 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: jenny | last post by:
Hi, I am trying to find a VB way that would create a folder on all existing drives - the folder name would be the same on each drive. ie c:\backup, d:\backup, etc. But the folders would only be...
7
by: Jeff | last post by:
First, how can I get asp to create a table in en existing DB that is an atuonumber. Meaning.. If say table 56 exists alrady, I want it to create 58 as the name. Along with this, I need to copy the...
0
by: Ken Wigle | last post by:
All, I am trying to add some .net applications I wrote to a virtual directory underneath the sharepoint services web site. I am having some problems and wondering if a) this is possible and/or...
0
by: Devon | last post by:
I have a web setup project which creates a virtual directory in IIS and populates it with all my website files. I want to create a directory inside of this virtual directory and set its path to an...
4
by: Bob | last post by:
Could anyone suggest me some examples/articles on creating a setup program in VS.NET that can install the assembly into the GAC? I have done some search and research myself and have some basic...
3
by: John Dann | last post by:
Is there any recommended way of creating a new version of an existing project inVB.Net? Or maybe an add-in that facilitates this process? Like most people I guess, I tend to develop projects in...
2
by: Bill Nguyen | last post by:
I would like to add a new VB.NET project using the same folder being used by another project so that I can share several forms already creaded by the other project. However, .NET created a new...
2
by: tatemononai | last post by:
Ok, this is a very unique bug. I have only been able to find one other post related to this online, and everybody who responded misunderstood the problem. I am not trying to reference anything in...
2
by: 123456prakash | last post by:
I have folder called bin in which i have put all my class files and the required jars file . I have 4 jarfiles I created a manifest file Test.txt inside the bin folder and the content is given...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.