Relative Content

Tag Archive for excelvbasave-as

How to overwrite my current workbook in excel with an existing template workbook

I have a workbook with a template file in a secure location (“M:template.xlsm”). I have an identical file in an editable location (“s:working template.xlsm”. After someone is done with the working template, the code saves it to a third “archive” location with a variable name also in the S drive.
I am running a software that can only send data to “working template.xlsm”. I want to be able to copy the template and replace the working template with the template and keep the working template name.

Excel VBA WB.SaveAs works only in debug mode or vbModal

I have made this code where from a modeless user form a user can control a machine using VISA, take data from it and immediately graph it on a fresh workbook. The user should also be able to create as many workbooks as they please placing different data on the workbook they have selected. My issue is performing pWb.SaveAs on a workbook in the clsWorkbook class that was created in clsWorkbookManager which passed the newly added/created workbook reference into the initializer of clsWorkbook and into the pWb variable. The SaveAs function of the workbook does not work in the button click section as expected, I want it to work there. I am running 64-bit windows 10, MSO 64-bit Excel windows 10.