Code-Vault | Some Secrets are Meant to be
kandi X-RAY | Code-Vault Summary
kandi X-RAY | Code-Vault Summary
Some Secrets are Meant to be kept.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Demonstrates how to enter an email .
- Handle a POST request .
- Add two numbers .
- Get the list of sub URLs .
- Register a user .
- Checks if this rectangle overlaps the specified rectangle .
- Count the number of words in a string .
- Check the user password .
- Sets the zero values in the matrix to zero .
- Gets the response .
Code-Vault Key Features
Code-Vault Examples and Code Snippets
Community Discussions
Trending Discussions on Code-Vault
QUESTION
Good afternoon,
I would like to check all files in my directory. For this purpose, I decided to loop through all of them.
The good code I found here:
and changed it consequently for my personal purpose.
...ANSWER
Answered 2020-Aug-06 at 15:36I have seemingly the same code and it works fine.
When i pickup some code somewhere i tend to make small changes step by step and make sure its still working every change i make.
QUESTION
I wonder if you could help me with the following problem.
I have a huge document that contains many duplicate paragraphs. I've found a macro on the Internet that can find them all and delete them:
ANSWER
Answered 2020-May-29 at 22:17Simply change:
QUESTION
I have hacked together code (from a couple of sources, references at the bottom) that programmatically will take worksheet scoped named ranges and convert them to workbook named ranges. However my code only works for some named ranges and not others, and I can't figure out why.
The reason I'm having to do this is because I had to delete two tabs (one of the tabs containing _T and the other _X) from the original source and copy in the duplicates of these tabs from another source. This leaves me with workbook scoped named ranges of #REF!#REF and worksheet named ranges that have the ranges I want but I need them Workbook scoped.
See code below
If I run this code looking for "_T", it works perfectly. All workbook named ranges starting with _T that were #REF!#REF now have the correct range and their counterpart worksheet named ranges are deleted. HOWEVER, if I run this looking for "_X", the workbook named range goes unchanged. I'm stumped. I have even tried a different approach where I manually delete all of the current workbook named ranges starting with _X, and then programmatically try to Add them using ActiveWorkbook.Names.Add Name:=newNm,RefersTo:=nm.RefersTo
which also does nothing (doesn't even add a new record).
Thanks in advance for the help.
...ANSWER
Answered 2020-May-27 at 08:25Try this:
QUESTION
I am losing my mind over this and I know it is much more simple than I am making it.
I am looking to simply replace multiple occurrences of text with a hyperlink that is masked by the same text.
Scenario: We are moving to Google Classroom due to Covid-19 and we are thinking ahead to September. I can export pupils timetables in bulk to excel as HTML files (lets call this file timetables). I have a separate file with a list of all class names and the links for the Google Classrooms (lets call this one classes). I have copied these values into 'Sheet1' of the timetable file for the code below.
If I can use the classes list to search for all occurrences of the classes in the timetables then replace them with the hyperlink to the google classroom but I want it to appear as the classname.
This is an image of the classlist file. Imagine there were all classes listed and links were valid.
I have been trying this code that I found but cannot get a working hyperlink in the "replace" element.
...ANSWER
Answered 2020-Apr-30 at 15:41Try this. It appears that the link requires the full address including "https".
I mocked up a two-column table and a few values to test.
QUESTION
I just ran into an even more annoying problem. Suddenly windows defender started to flag one of my excel files containing VBA macro code(on download from a browser) as being a virus. The specific virus being logged is:
Googling it reveals the following information:
Great, so once windows defender detects it, it basically shreds the file, and when you attempt to open it, excel claims the file has "been corrupted". I would love to post my VBA file to http://www.virustotal.com however it contains tons of propriety VBA code that cannot be shared with the wider community. I wonder if there's a website that accomplishes the same thing with a different terms and conditions?
This has only started recently and has only affected a few users/clients. I'm not sure the distribution of clients who have this installed and what versions of windows defender they are running. I'm worried the impact of this will increase until a large number of our clients are affected. Even more troubling, often clients can download one version without issue, but when they download the file(identical VBA code) from a different source they encounter the issue, could the download source affect the files likelihood of being flagged?
Main Question
What causes a excel VBA file to be flagged as a "O97M" virus and how do I prevent it from being flagged?
Related Concerns
Should I sign my VBA Macro's, would that affect the virus detection likelihood?
Are they're other common practices that I could change that would affect the likelihood of false positives?
What is a "Trojan:O97M/Foretype.A!ml" exactly? The window page contains so little information it might as well not exists, Symantec is also pretty unhelpful, (maybe I'm massively uninformed here) is there a centralized repository for virus detection? I would imagine that people may not want to share that and it my differ by product, but I'd be interested in any information pertaining to this...
External Libraries
I'm also using the following external code:
I'm also using the following window functions:
...ANSWER
Answered 2018-Nov-11 at 08:11Started to get the same problem with one of mine xlsm-files as well a couple of days ago (2018-10-29). I've made the file from scratch so I know that it don't contain any virus.
Don't know if Windows Defender reacts on one of the following things:
- File is stored on my OneDrive
- It contains code for downloading from the web (json-data and images)
Only thing that I haven't made on my own is this code that I'm using: https://github.com/VBA-tools/VBA-JSON/blob/master/JsonConverter.bas
My guess is that Windows Defender reacts on the JsonConverter-code, the "Trojan:O97M/Foretype.A!ml" might be using a similar code.
QUESTION
I am trying to convert a large number of xls files to xlsx. I found some code here that I modified to SaveAs
with a new format. However, some fraction of my files are corrupt and they cannot be opened. I would like to simply skip those files and so I added the lines indicated in the comments (prefaced with the word ADDED
.
Every time I run the code I still end up with a run-time error with a message that the file cannot be opened (1004 Method Open of Object Workbooks failed). I use the debug button and the Set wb~
statement is highlighted. I have tried many variations of the use of colons (I have very little experience in VBA).
Let me be clear - I have the same result whether or not there is a colon after the NextFile
.
ANSWER
Answered 2019-Aug-01 at 21:50As GSerg said, changing GoTo TryAgain
to Resume TryAgain
should fix it.
That said, a more intuitive layout might be
QUESTION
I am trying to remove animation with the help of vbscript in powerpoint. But it should remove only from selected slide not from all slides
I have tried some code but it's removing from all the slides sharing below the sample code, can anyone please help me with the solution
...ANSWER
Answered 2019-Aug-01 at 22:05For just the selected slide:
QUESTION
Objective: in a table, allow users to select rows (the rows where the SELECTION is), press a short cut and delete those rows. No matter if they are filtered and the selection is in non contiguous ranges or not.
I have the code below I got from another site and modified it:
The problem varies, from runtime error 1004: can't move cells in a filtered range or table to delete method of class failed (or something, it happens less often than the first one)
...ANSWER
Answered 2018-Jul-24 at 05:15I think you've got a couple issues going on here, but one for sure, which might seem counter-intuitive.
When programmatically deleting multiple non-consecutive rows/columns/cells/areas, it's best to do so in reverse.
When you delete a row, Excel shifts the rows beneath it up. Therefore, the subsequent row numbers become easily confused, causing errors or, worse yet, unintentionally lost data.
ExampleImagine you want to delete rows
1, 4, 5 and 7
. If you delete them one at a time, starting at the top, then you'll delete row1
, which makes the other rows numbers to delete3, 4 and 6
. Delete3
and now you need to delete3 and 5
.To remove rows
1, 4, 5 and 7
one at a time, starting at the top, you'll actually need to delete rows1, 3, 3, and 4
(yes, you'd be deleting row3
twice).
There are a couple ways around this:
- Delete all the rows at once. You could join each of the selected rows with the
Union
method and then delete the entire range at one.
Or, my preference:
Iterate through the rows backwards, starting at the bottom of your data and working your way up. Since
For..Each
loop can't be made to go in reverse, you'll need to switch to aFor..Next
.You can find the last populated row (using column A in my example) with the
Range.End
property, and then use theIntersect
method to compare each row to the user's.Selection
of rows and/or cells. If they two intersect, then you can.Delete
the row.
Example :
QUESTION
I have found a vba script to find and replace words but the script replaces the words in the whole workbook, I would like it to replace the words only in a specific sheet. This is the code I have found.
...ANSWER
Answered 2019-Jan-24 at 19:10Just remove the sheet loop and specify the sheet name in the code where it says "Sheet1".
QUESTION
I'm importing several sheets of data to another workbook and wanted a simple way of converting the strings that are numbers into numbers. So I found this code that did exactly what I wanted https://www.thespreadsheetguru.com/the-code-vault/2014/8/21/convert-numbers-stored-as-text
It ran fast and smoothly which was very appreciated, but when I started to work with the data I noticed a discrepancy. I found that two cells had converted into two completely different numbers. As of writing these are the only two I have found, but it is quite worrying if there could be more. An example is the string "1,225" became -611779. (Yes I'm using decimal commas)
For some reason it decided that these two "strings" of numbers was something completely different. Yet, the same numbers, in another sheet, had been correctly converted.
My question now is: is there some reason that these two (and perhaps more cells) could have caused the script to completely fail in converting these numbers correctly. Or is the code flawed?
...ANSWER
Answered 2018-Oct-08 at 20:01The problem with that code is that the VBA IsDate
function will use, among other things, a comma as a delimiter. So 1,225
gets considered to be the date 1-Jan-225
. Since that is not a legitimate Excel value, it gets converted to a negative number (prior to 1-Jan-1900
).
If all you are dealing is converting numbers stored as strings to real numbers, then you can use:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Code-Vault
You can use Code-Vault like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the Code-Vault component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page