My problem is this:
I have a button called PRINT/SAVE which I use to print and save the doc. I
also have a log file which I need to open to write to before saving.
When I use the button, the file does not open, however, if I just use the
standard PRINT or SAVE button the code runs OK and the file opens.
This is the routine where the button code resides:
I then jump in and out if the following:
Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, cancel As Boolean)
Function IsWorkbookOpen(WorkbookName As String) As Boolean
The line that is the problem is within: Sub ActivateWorkbook2()
and is: Set Wkb = Workbooks.Open(filename:=stFullName), it seems to be
ignored and the consequence is apparant later in Sub ActivateWorkbook2()
because I am trying to write to the 'Still Closed' file. - SUBSCRIPT OUT OF
RANGE is the error message.
If I save the file using the save button I dont get a problem opening the
other file and the only difference in the procedure is that I dont enter the
"Sub PrintAndSaveButton_Click()" procedure.
Any ideas of the problem would really be appreciated, I am at the moment
Thanks in advance