ok - got it working. What a pain in the butt!
Sub live_working_code()
str_to_pass = "dir FOLDER PATHWAY /b /a-d > ""TARGET FOLDER PATHWAY\vba print long.txt"""
Call Shell("cmd.exe /s /k " & str_to_pass, vbNormalFocus)
End Sub
the "cmd.exe /s /k" instructs command prompt to receive the...
I've tried to run the cmd code in VBA, but it isn't able to run the command. It will open command prompt, but it won't execute the code.
I've tried VBA.SHELL and SHELL. There aren't any other articles that I can find that would indicate that this is supported.
Here is an example of one of...
I did find this for cmd prompt which seems to be near instantaneously. This is good for a single folder at a time. I'd need to convert this for every sub folder though.
Thoughts?
dir FOLDER DIRECTOR PATH /b /a-d > "C:\print.txt"
Hi Andy,
The sandbox has 26k files = 4 minutes
Production can have 250k+ files = ??? minutes / hrs. / years?
Is there a "quick" way to get a database index inside Excel so I can get away from a live folder search?
When I use cmd prompt as a comparison to just try and index production, it...
Hi Andy,
We have 13 different folders with prints in them. The same part number drawing can be in multiple folder just the file name is different. The file name consists of the part number, rev letter, and status of the print.
My macro is designed to search for all the first level folders...
Hi Guys,
Sorry for going dark on this thread. Yes I got it working.
Now I have another issue.
To index all the file names in the root older and sub folder in my sandbox takes about 4 minutes. There are currently about 26,000 files that it goes through.
I've been informed that in the...
Andy,
I am writing code so that it indexes the sub folder list and then tacks it onto the folder pathway at the end so it can start the search over again with a loop statement.
Hi All,
I need to search a folder and sub folders for a file name containing some value. In the past it looked like Application.FileSearch was a valid way to get the list. Now, Application.FileSearch looks to have been obsoleted in the early 'ots.
Is there an updated method? I've looked at...
Hi Strongm,
Does the second button call stoptimer() which triggers the cancel operation?
Public Sub stoptimer()
Application.OnTime printticktime, "thisworkbook.pdf_print_macro", , False
End Sub
Hi,
I have a macro timer that runs every set period. This macro works just fine, but at some point, a user might need to stop the macro timer from running its next cycle.
The period can be as short as every 5 seconds or as long as 24 hours.
I've tried several of the error(18) capture...
If you have Manage Data Model under the Data tab, you might be able to change the data source type there.
Here's a general article on how to make a change. It might be a good starting point.
How to create a date table in PowerPivot with one single value
Hi All;
I am trying to return values from an array based on a search term. The array is being captured correctly but I can't search the array return correctly. When I hardcode the array, the search does work.
I get a type mismatch 13 when I run the code.
Worksheet = "data"
dynamic table =...
Hi All;
I am running into a situation where I get a runtime 53 error that I am not able to handle correctly. The error occurs on the second occurrence of an error in the DO UNTIL loop when processing the ted.txt to TED FIVE.txt file name conversion. I expect the error to occur, but it should...
Hi All;
I'm not sure if this will help you, but I think I created some code to use as a template for calculating different things related to dates.
Hope this helps someone. I'll be honest, I haven't verified this code other than simulated so it might not 100% work :)
Sub Holidays()
Dim...
Hi Andy and Combo,
Trust me when I say this, a database is going to be a whole lot more difficult for someone to understand and maintain lol.
I did think about the paste button, but that is going to create more problems for the particular user. It always sucks when you need to design...
Thanks combo. It looks like there is a secondary issue that I didn't see until I started testing.
So, the user is copying data from a file where the cells are defaulted to locked when the worksheet is password protected. When I set the paste to worksheet to not protect the cells in the...
Hi Combo,
Just to confirm, this allows all the functions of the macro to run, but still prevents the user from having access to the protected catagories?
I read the Microsoft article and just want to make sure that I have it correct.
Link
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.