kyddrivers
Board Regular
- Joined
- Mar 22, 2013
- Messages
- 57
- Office Version
-
- 365
- Platform
-
- Windows
I am running into an issue with several macros that export tabs into a separate workbook, breaks links, copy/paste values, save as the workbook and then closes.</SPAN>
The error forces excel to close completely and seems to happen about the time I am doing the save as.
Any words of wisdom to correct this issue is greatly appreciated
Code:
Sheets("Site").Select
Sheets("Site").Copy
ActiveWorkbook.BreakLink Name:= _
"[URL="file://\\path"]\\path[/URL]\file.xlsm", Type:= _
xlExcelLinks
Cells.Select
Range("C1").Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("C1").Select
Sheets("Site").Select
ActiveWorkbook.SaveAs Filename:= _
"[URL="file://\\P"]\\[/URL]path\Site.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Application.CutCopyMode = False
ActiveWorkbook.Close
The error forces excel to close completely and seems to happen about the time I am doing the save as.
Any words of wisdom to correct this issue is greatly appreciated