I have two documents. sourcedocument and fulldatafilename. I pull data from the fulldatafilename, paste into sourcedocument and then close source document.
I can open fulldatafilename and work with it and even switch between the sourcedocument. but I can not seem to close the fulldatafilename. and I have not 'undefined' fulledatafilename.
I am using similar coding to below. (I have simplified it to the basic code for easier reading). assume I am runnig the macro from sourcedocument
not sure why not working bc Workbooks(fulldatafilename).Close False or similar code works in other macros.
I can open fulldatafilename and work with it and even switch between the sourcedocument. but I can not seem to close the fulldatafilename. and I have not 'undefined' fulledatafilename.
I am using similar coding to below. (I have simplified it to the basic code for easier reading). assume I am runnig the macro from sourcedocument
HTML:
Dim fulldatafilename As String
Dim sourcedocument As String
fulldatafilename = "data file 089-2.xlsx"
sourcedocument = "JOBS Weekly Template.xlsm"
Workbooks.Open Filename:=fulldatafilename 'this works
'******code for copying data from fulldata filename here
Windows(sourcedocument).Activate 'this works
'******code for pasting data from fulldata filename here
ActiveWorkbook.Save 'this properly saves the source document
Workbooks(fulldatafilename).Close False ' this is the part that is not working.
not sure why not working bc Workbooks(fulldatafilename).Close False or similar code works in other macros.