I have made a macro for copy and paste into a new file.
Copied it into vba editor into my code.
Worked fine, but not anymore.
It makes a new file but as soon as it wants to go back to
"Windows("file.xls").Activate"
"it gives a suscripts out of range" error
I have checked for the value of "strBestandMap"
and "strBestand" both are not changed and are fine.
This is my code:
VB Code:
Workbooks.Add ChDir strBestandMap ActiveWorkbook.SaveAs Filename:=strBestand Windows("file.xls").Activate Sheets("resultaten").Select Cells.Select Selection.Copy Windows("" & strBestandNaam & "").Activate Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False Range("A1").Activate ActiveWorkbook.Save ActiveWorkbook.Close
Thanks in advance,
Brian




Reply With Quote