To any takers...
My company just recently moved to Office 2010 from 2003, and one of my macros is giving me:
Run-time error '5353':
You cannot save while the file is in use by another process. Try saving the file with a new name.
The specific part of the code copies a reworked portion of data from excel to microsoft word and saves it to a folder on my desktop.
The code in red is where it breaks. I can post the entire sub procedure if it helps, but I'm hoping someone has had issues like this before. I've already enabled the Microsoft Word object library through Tools>References in VBA window.
Any help would be much appreciated, I'm totally stuck.
Thanks!
Running Excel 2010 recently upgraded from 2003 on a windows XP machine.
My company just recently moved to Office 2010 from 2003, and one of my macros is giving me:
Run-time error '5353':
You cannot save while the file is in use by another process. Try saving the file with a new name.
The specific part of the code copies a reworked portion of data from excel to microsoft word and saves it to a folder on my desktop.
Code:
Set AppWD = CreateObject("Word.Application")
AppWD.Documents.Add
Workbooks("Positive Pay Upload Creator").Sheets("Compiled").Activate
Workbooks("Positive Pay Upload Creator").Sheets("Compiled").Range("A1").Select
Range(Selection, Selection.End(xlDown)).Copy
' Paste the copied data into the new Word document in text format, to prevent formatting
' the data as a table. Save the file in TextLineBreaks format to retain line breaks, but
' remove all other text formatting in the output file.
AppWD.Selection.PasteSpecial DataType:=wdPasteText
[COLOR=#ff0000]AppWD.ActiveDocument.SaveAs Filename:=OutputDataLocn, _
FileFormat:=wdFormatTextLineBreaks
[/COLOR] AppWD.ActiveDocument.Close
AppWD.Quit
The code in red is where it breaks. I can post the entire sub procedure if it helps, but I'm hoping someone has had issues like this before. I've already enabled the Microsoft Word object library through Tools>References in VBA window.
Any help would be much appreciated, I'm totally stuck.
Thanks!
Running Excel 2010 recently upgraded from 2003 on a windows XP machine.