For my work i need to track what cases i did. Right now i note all the case numbers in an excel file where i also sort them to the categorie they belong. At the end of every week i then have to put in the numbers in our tracking tool with copy and paste (tracking tool isnt on the same desktop i work on so i cant do it directly)
So i thought maybe it would be possible to write a macro in the excel file that does the copy paste for me but i already fail when i want to switch from the excel to the tracking tool
I tried shell activate and windows activate but i only get run time errors
Im grateful for any help even different approches
Please add screenshots and more explaination of the scenario so we could have better insights
Related
tl;dr: Is there a way to have multiple (10+) excel Macro workbooks run the same project from a single location so that if I need to fix a bug, I don't need to fix it in every single workbook?
Long version:
My company uses excel workbooks for engineering charts. Any changes are formatted as bold and highlighted gray. We then have a revision "table" at the bottom (I say "table" because it's just some merged cells - there doesn't seem to be a way to make a separate table that doesn't follow the column sizing for the rest of the workbook, but that's a question for another day).
When we do a new revision, we have to first clear any formatting from the previous revision, make our changes (and format them), then insert a row to the revision "table", then unformat the previous revision entry and reformat our new revision entry. Then, we export the workbook as a PDF which we name according to our print naming format. However, it is easy to make mistakes when doing this because the file name must be manually entered according to the format.
To make this process less tedious/error-prone, I wrote a VB macro program to automate the above steps, among other things. It works great, and will be implemented on our charts company wide.
However, I can only do so much testing on my own - there are bound to be things I missed or can do more efficiently (I'm an engineer, not a professional programmer). And we have dozens of engineering chart spreadsheets. If we implement this and then I discover I need to fix a bug or make an improvement to part of the program, I don't want to have to fix it in every single workbook - that would take way too long and be too easy to miss a workbook!
Any advice would be appreciated.
First timer here...
I know some of you will be tempted to throw cans of beer at me for doing this, but I am using Excel/VBA to create some sort of animated GUI specification:
I create each UI of my application in a separate sheet
I use cells as well as I use ActiveX controls (combo, check box, etc)
I am doing very basic UI stuff such as showing/hiding lines based on current combo box selection, automatic update of a cell based on the modification done on another cell, really no rocket science here.
Until yesterday, all was well, everything worked (more or less) and today, this shows up when I reopened my work:
Just to make it clear, I am using this to generate the code:
With a new xlsm file, this does not happen. It starts looking like a corrupted file... However I cannot afford to copy/paste all my stuff from the corrupted file to the new one because of this.
So has anyone run into this ever?
I used a VBA Cleaning Tool.
Excel VBA Code Cleaner did not do the trick.
VBA Toolkit Excel Add-in powered by Ribbon Commander did.
All is in order now.
I want to make a dynamic excel sheet that updates whenever a file is being created into a folder, think of letters. So the sheet needs to extract the name of the letter, the date&time when it is made, the author and so on, into a table in excel. Does anyone knows how to get that filedata?
I already know how to put data in a certain cell using VBA but the thing i get stuck in is how to get that data from a certain folder.
As Ron said, there is no event in VBA to handle that. However, if you want to stick to VBA only, you have basically two options:
You can update your cell whenever the workbook is opened using the Workbook.Open event (https://learn.microsoft.com/en-us/office/vba/api/excel.workbook.open). This is not really dynamic but might be sufficient (depending on your needs).
Other option would be to call a function periodically to check if the folder content has changed (https://learn.microsoft.com/en-us/office/vba/api/excel.application.ontime)... Not very performant, but would work for sure.
For the file data just follow Ron's suggestion.
Hope that helps, MJ.
I am looking for a solution were a given excel range can be converted to an image without copy and paste or without putting anything in clipboard.
The reason for this is because the VBA code will be running in the background and the user will continue their regular work. So when they do any copy and paste activity happens 'oRange.CopyPicture xlScreen, xlPicture' code hits an error.
The tool will run every 60 seconds.
I have checked a lot of web portals to find an answer, but most of them are limited to 'CopyPicture'. One webpage example given below.
http://vbadud.blogspot.com/2010/06/how-to-save-excel-range-as-image-using.html
Can someone please help me.
Found a solution, might not directly solve this. I have created another instance of windows log in and run this Marco at regular intervals in that instance.
This way we have two different clip boards that will not conflict.
Using Excel/Word 2007 I'm trying to copy multiple selections from Excel to Word. When I paste it into Word it's as if it ignored the break in the ranges and just pastes a range that includes everything I was trying to leave out.
For instance if I intend to copy/paste "A2:D4, A6:D7, A10:D11" what is actually pasted in word is "A2:D11", so it's ignoring the breaks in the selections. I can't seem to find any documentation on this issue anywhere. If someone knows anything I'd really appreciated it. I know I'm selecting the ranges properly because if I copy and paste the multiple ranges within Excel it works like it should.
The actual issue is that I have these actions automated in a macro and I'd really prefer not to loop through the individual ranges because they're stored in a dictionary and it would be just a real hassle. Despite that, it seems weird that I can't even accomplish the task manually.
I've done quite a bit of digging and can't seem to come up with anything. I thought about using the Office clipboard but you can't paste tables as an RTF. It doesn't seem like there are any options when pasting with the office clipboard.
AFAIK it doesn't seem possible and I've tried to exhaust all my normal avenues of knowledge before posting here. If anyone has ever just experienced this it would be comforting to know I'm not alone.
I don't know how to prevent that from happening, but you could potentially work around it by pasting your non-continuous selection into a continuous region in a new, temporary sheet/workbook, then copying the continuous region from the temp sheet/workbook into word.
a bit of a hassle, yes, but it should get the job done.