SantoOnofre
New Member
- Joined
- Sep 30, 2017
- Messages
- 7
Hi, Everyone!
I'm from Brazil and this is my first post. Sorry for start asking for help, but I already searched everywhere, without any solution for my problem. Maybe you can help me.
The question is:
I bought a software (with a large database), and its output is a simple Excel workbook, not saved anywhere (no path), named genericly "Book1", that simply pop up on my screen.
Everytime I ask the software for this output, I need to copy the content of this workbook and paste into another workbook, a mother-workbook, as I named it, to consolidate all the data.
Once I have to repeat this action dozens times a day, I thought it would be a great idea create a VBA code to automate this task. So... I made a very simple one:
</code>
The problem is... Each time the software output a new workbook, it seems that is created a new instance inside the Excel, for wich my macro doesn't reach. I mean, I run de code, but nothing happens, because my mother-workbook doesn't find the generic, unsaved and located in another excel instance "Book1".
If I open the mother-workbook after the output is opened, OK, the code works, because both are in the same instance. But as I need to keep the mother-workbook open all the time, I can't do this. I don't want to save each new output file either. It would take me a lot of time.
I'm using the 2016 version of Excel, but already tried the 2010 as well. My OS is Windows 10 Pro.
Any thoughts?
Thanks a lot!
I'm from Brazil and this is my first post. Sorry for start asking for help, but I already searched everywhere, without any solution for my problem. Maybe you can help me.
The question is:
I bought a software (with a large database), and its output is a simple Excel workbook, not saved anywhere (no path), named genericly "Book1", that simply pop up on my screen.
Everytime I ask the software for this output, I need to copy the content of this workbook and paste into another workbook, a mother-workbook, as I named it, to consolidate all the data.
Once I have to repeat this action dozens times a day, I thought it would be a great idea create a VBA code to automate this task. So... I made a very simple one:
Code:
<code>
ActiveWorkbook.ActiveSheet.Range("A1:C32").Copy</code><code>
Workbooks("Mother-Workbook.xlsm").Worksheets("Sheet1").Range("B6:D37").PasteSpecial Paste:=xlPasteValues</code><code>
</code>
The problem is... Each time the software output a new workbook, it seems that is created a new instance inside the Excel, for wich my macro doesn't reach. I mean, I run de code, but nothing happens, because my mother-workbook doesn't find the generic, unsaved and located in another excel instance "Book1".
If I open the mother-workbook after the output is opened, OK, the code works, because both are in the same instance. But as I need to keep the mother-workbook open all the time, I can't do this. I don't want to save each new output file either. It would take me a lot of time.
I'm using the 2016 version of Excel, but already tried the 2010 as well. My OS is Windows 10 Pro.
Any thoughts?
Thanks a lot!