Faced such a problem. Create an empty form with a button and a code to click on the button

Dim ws As Worksheet Unload Me With ThisWorkbook .Worksheets.Add Set ws = .ActiveSheet ws.Move End With Set ws = Nothing 

Next on the sheet, add a button from the section "Form Control", which shows this form.

The problem is that the book created by the macro is somehow not fully activated (for some reason, when trying to print, the original book is printed). It is observed in Excel 2013 x64. In earlier versions, this is definitely not.

How can this be conquered? Activation of a new book occurs if you first switch to the old book with pens, then switch to a new one again, but this operation does not give effect through the code.

    1 answer 1

    I did not find a solution to this problem. There is a workaround — instead of using the form control, use ActiveX controls. With them, this problem does not arise.