I'm at work, with a folder in which we create a daily excel sheet to manage our clients. For the sake of understanding let's imagine this files is in a folder called OCTOBER and they are named MD01, MD02, MD03... based on the day we are.
I was trying to setup a shortcut on my desktop that will call the correct file every time so I don't have to go trough the file structure to access it. Something like this:
"....\OCTOBER\MD%DAY%.xls"
But the moment I try to setup the path this way I get an error say this is not a valid path. Well, either I am missing something here or what? Can't this be done?
A typical method is to create a link to a master file in the folder (say master.xlsm) The master spreadsheet would automatically:
determine the date
determine the appropriate file to open
open the file (say MD10.xls)
close itself
Alternatively you could create a little vbscript or powershell script or .bat file to do the same thing.
Related
I have a fair understanding of basic to intermediate VBA coding - here's the predicament I am having at work - I am responsible for maintaining this master excel file that consists of 35 tabs and macros and event procedures etc. - this file is used by the other team (more than 10 people) as the primary tool for carrying out their daily tasks - as the author i always keep an original copy of this file as a backup for any contingent event, and I put a copy of the file in the team folder for the team to use.
However, it sometimes happens that some of the team members would open this file in the team folder and make changes (they are told not to) as normal practice and accidentally save the changes withtout realising it - now that potentially creates an issue for the next user (good user) who would make a copy of this file and save it to their own folder and continute to work on with it (good practice) but they did not realise there has been data left in the workbook from the previous user - this kind of incident could create a disatrous consequency if it's left unnoticed.
I am trying to think up a way or series of codes that can resovle the issue - i just do not know which way to begin with - I was thinking of using SheetChange or Open (eg upon detecting any change then save as a new file in a different location) event - with that i ran into another issu- how i do ensure the subject event will not intervene other events that already exist in the workbook in the subsequential workbook?
any suggestion on structuring the code to accommedate this situation?
many thanks in advance
#VBA #event #savechange
as described in above
I would keep the master copy well hidden from them.
Then, consider putting passwords on sheets they MUST not change.
Or, consider sub-master files for the detail that each team can change and then your master file can link to those sub-files to get the latest data.
I had a project to manage that had 6 team members. Gave them each their own file and linked to their data. Also passworded the functions so they could not change or delete them.
Save the file as an Excel Macro-Enabled Template (.xltm) file.
This way, on double-clicking the file (as you would to open any other file), it creates a new file and will not automatically overwrite the old file when saving.
Instead of taking copies of the file, your users simply have to 'open' the file then later save as whatever they need to.
I can't figure out how to add a "save file/folder" input to Universal GUI.
I need to be able to pick a location to pass as a file or folder
to the cli program without the file/folder in question existing already.
Selecting a pre-existing file to pass to the cli command is easy, just use the generic file upload entry.
And Universal GUI already has a "select folder" entry.
Both options require selecting one that already exists.
So all I need is to be able to select a file and/or folder that doesn't exist in a "save" form.
I've never found an alternative to NW.js that doesn't require manually setting up the Node.js launcher.
So that's what I run the app I made in/for Universal GUI.
The folder browser is designed to allow you to select existing folders or create new ones. File select will also allow you to create new files.
It sounds like what you want is to use the folder selector, so the user can select the folder (or create it, then select it) as their output directory. Then give them an input text field to type a file name into. Then you just combine all of that together as an argument for the CLI.
<cmd executable="myexe">
<arg>--save "((outputDirectory))\((fileName)).txt"</arg>
</cmd>
<!--
What would be sent to the command line:
myexe --save "C:\Users\Bob\Desktop\SomeFolder\MyFile.txt"
-->
In SharePoint online when my flow moves the file (PDF, ZIP...) named "U000" in a folder where is a file with the same name it renames the file in "U0001".
How can I customize this to be renamed like "U000-Rev.1" or "U000_copy(1)" instead of "U0001"?
I know this is the default SharePoint behavior and there is no option for renaming format but maybe I can change or add a code in "definition.json" file from exported ZIP flow (or somewhere else).
(I'm not a software developer so any answer/idea is welcomed.)
Thank you!
Add an if statement to check the file name you just uploaded. If it contains (1) at the end of the name then rename the file. This is probably the least convoluted fast approach but it's not 100% robust.
You can add more logic or change the approach to make it fully robust but you can look into that after you've got something working imo, baby steps.
I am trying to create a batch file as icon on desktop, that would open a specific excel file, create a macro in it and copy code from a specific txt file into it.
The reason i need this, is that the file is located on a server and the ending .xlm cannot be cahanged (should not) so i cannot save it as a macro enabled file (to store a macro in it )
Could annyone with better understanding please explain to me how to create the said code ?
Thanks in advance!
In theory it's possible by using the VBE object (https://msdn.microsoft.com/en-us/library/aa443984%28v=vs.60%29.aspx). But that's not activated by default so you can not ensure that each user is able to do that.
Better find other solutions for that problem. Can you upload .XLSB for example? Or do you have another kind of server available - for example a database server - you can use for storing the file? We use this method here for deploying our updates on AddIns and report templates for example.
I'm wondering if this is possible and the best way to accomplish it if it is.
Scenario: We have multiple sites that create a "dated subdirectory" each day at a certain time. The dated subs contain information for that day of business.
I need to pull a single DBF file out of the dated sub each day and either export the data to an ever-expanding Excel file, that contains information from the single DBF file from EACH day so it looks like:
Day 1's information
.
.
.
Day 2's information
.
.
.
Day 3's information
OR
Add a copy of the DBF file from each dated sub to a ZIP file that is done daily.
The name of the DBF file never changes, and can't be deleted.
I'm thinking it could be done with a forfiles command, but am curious if it could be done more efficiently. The file that searches, pulls, and zips would be run as a task nightly.
As an add-on, could it be pushed to a Google Drive for safe storage?
Sorry if this is rambling. This is something I'd love to try to do, but not sure where to start exactly.
-Dated sub created nightly, single file from that directory needs to be pulled or read and transferred either to an Excel file or copied to a ZIP with a way to seperate each file, maybe a directory with date as name?
Also, if able, it needs to start with a particular date, like 6/1/2014 but no further back.
Thanks in advance for any help.
Can you merge data from a DBF file to an Excel file? Not really with pure batch, but you can use JScript or VB Script. You'll need the MS ACE OLEDB 12.0 driver. Then you can use a connection string for DBF and another for XLSX. (If you're using XLS or CSV, you could get by with the MS Jet driver, running the WOW64 version of cscript.) Once connected, just use SQL queries. SELECT * FROM dbffile, and as you're looping through the recordset, INSERT INTO xlsxfile.
Can you append a DBF file to a zip file? Probably. I'm guessing 7za.exe a will append to the archive if the archive already exists. Try it and see. Or were you wanting to script the zip functionality without 3rd party software?
Can it be copied to a Google Drive? Well, yeah, the Google Drive software watches and mirrors a folder on your hard drive. So chances are, copying the file to %userprofile%\Google Drive\ will do what you want without any conscious effort.
Try posting another question. But rather than rambling again, find one specific problem where you're getting stuck, and explain what you've tried without success.