I am making a macro that will export data from an excel sheet to a powerpoint presentation to skip repetitive copy and pasting. Some of the data I'm grabbing is of variable size. I want to use the input box to allow the user to select the needed ranges. However, upon opening the powerpoint presentation, I can't get the macro to refocus to the excel workbook so that the inputbox automatically pops up. The macro will just pause until the user clicks on the workbook. I hope to remove this pause. Additionally even without the pause, the workbook will need to be the top window in order for cells to be selected.
I have attempted the following with no success
Not sure why this doesn't work.
I've also tried resetting the windowstate to maximized to cause a refocus back onto excel. Initially this was unsuccessful. However, upon writing this post I tried minimizing excel and then maximizing it, which DID work.
Are there any suggestions on the right way to do this?
I have attempted the following with no success
Code:
Dim wb As Workbook
Set wb = ActiveWorkbook
'code for opening ppt presentation
wb.activate
Not sure why this doesn't work.
I've also tried resetting the windowstate to maximized to cause a refocus back onto excel. Initially this was unsuccessful. However, upon writing this post I tried minimizing excel and then maximizing it, which DID work.
Are there any suggestions on the right way to do this?