473,405 Members | 2,294 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,405 software developers and data experts.

Autosaving file by date as part of the file name

When I use this code the file is only saved at:
c:\MarketActions and not in the subfolder \Egypt.

Where is the problem?

Expand|Select|Wrap|Line Numbers
  1. Sub SaveFile()
  2. ActiveWorkbook.SaveAs ("c:\MarketActions\Egypt\" _
  3.  & Format(Now(), "YYYYMMDDHHMM") & ".xlsm")
  4. End Sub
  5.  
Please advise
Aug 18 '15 #1
1 1338
Stewart Ross
2,545 Expert Mod 2GB
On the basis that there is nothing obvious wrong in what you have posted I suspect that this sub may not be executed as it stands. If the sub folder Egypt was incorrectly named, say, Excel would tell you that the path was invalid. If you have Excel's warning messages turned off then you would not get notification of an error, but nor would the file be saved. Saving one folder up is not behaviour that I recognise.

I suggest you set a breakpoint in the code which calls the sub, then step through it line by line to check what is going on. Make sure you start with no previous files saved in your folders to avoid potential confusion of your tests.

-Stewart
Aug 19 '15 #2

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

Similar topics

4
by: mbosco51 | last post by:
Hi. I am tring to setup an asp script that will do the following... If file date/time is within last 10 minutes then response.redirect to file else do something else end if The text file...
12
by: Woodster | last post by:
I currently have some code for an application that is running on Win32. I have tried to keep anything not directly gui related as separate as possible for portability reasons, including file...
0
by: GrantS | last post by:
Huys Thanks for your help. Indeed, I did have the correct sytax and was looking in the correct directory. BUT the files were not there by the time I was checking for them. Silly me. Cheers ...
2
by: mamin | last post by:
I have a table that I need to export out to a text fiel, without column headers. I also need to have the file name include currernt date. Can anyone help me? I'm using the following code: ...
5
by: nkechifesie | last post by:
Hi, I have written a VBA program that runs on Excel and puts data on the excel sheet. This runs everyday. I want to be adding the dates to the files, this date is gotten from the excel sheet that...
5
by: cssExp | last post by:
alright suppose i have the following. <input type="file" name="upload" /> <input type="text" name="discription" /> <input type="image" onclick="addFile();" src="images/addfile.jpg" name="add"...
1
by: mastro78 | last post by:
I'm using 2002 I defined my recordset as rWrkSheet Spreadsheet is the field in table Spreadsheets PathToExcelFiles is the full path where the Excel files i'm ref is stored ExcelFileName is the...
185
by: jacob navia | last post by:
Hi We are rewriting the libc for the 64 bit version of lcc-win and we have added a new field in the FILE structure: char *FileName; fopen() will save the file name and an accessor function will...
1
by: koneyji | last post by:
I need to read a file from a text box and create a new file using file.create command and the new file should have.enc extension. I tried but can't get it to work. the program goes like this ...
1
Coldfire
by: Coldfire | last post by:
Hi, The strange problem i am having is, the input element of type='file' not reading file names after 20 file elements. It simple returns null on reading the 'name' of file. The code is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.