Excel 97-2003 Macro does not work in Excel 2013

I have an Excel file that was done in Excel 97-2003. It contains a macro. The macro runs fine in Excel 2010 but have now had to convert to Excel 2013 and the macro does not work. I am only a basic user on macros; can someone point me in the right direction? I get "Error 9". I tried to understand the debugger but I could not figure it out.

 AllowFormattingColumns:=True, _ AllowFormattingRows:=True Sheets("Print-Send").Select Cells(counter, "D").Select ActiveCell.FormulaR1C1 = ("") Sheets(model).Select Sheets(model).Move _ After:=Workbooks("Compressed CPC.xls").Sheets(3) 'error here Range("B4").Select Selection.ClearComments Range("A8").Select Selection.ClearComments End If counter = counter + 1 Loop
End With
6

1 Answer

Based on the limited code you posted, I have some guesses

  • Do you have the workbook "Comproessed CPC.xls" open when the code is run?
  • Does the workbook "Compressed CPC.xls" have 3 sheets in it?

And doing some further research it looks like Error 9 may have to do with getting data from a closed workbook. As found in an article from titled "VBA Runtime Error 9 – Data From A Closed Workbook"

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like