Excel 2007 Macro - Runtime Error 1004 After Saving And Re-opening A FileOct 25, 2009
I have an Excel file with utilizes macros to allow a user to enter names of people and then double click on cells to enter ratings via radio buttons. When I open a blank file and enable the macros, I can add users, rate their skills using the radio buttons, etc. with no issue. I then SaveAs the file and continue working on it. once I Save and CLOSE the file, then go to re-open it, the trouble begins. Keep in mind, there is no alteration to the macros directly. Just entering data and using the form as intended. Here's what happens.
I reopen the file.I enter in the name of a person on one line. I go to the first box - double click on it.It is supposed to pop up a dialog box which allows me to choose a rating via radio button (as I had been doing before I closed the file). Instead, in that first column of ratings, it instead gives me the following error:
Runtime error '1004'Unable to set the LineStyle property of the Border class
When I hit "debug" this is the code it points to:
If ActiveCell.Column = leftb Then Range(Cells(ActiveCell.Row, leftb), Cells(ActiveCell.Row, rightb + 1)).Borders(xlEdgeTop).LineStyle = xlContinuous I have no idea why this would not work when I re-open the file!
note that when I go to click on the subsequent cells (there are 8 cells in which you provide ratings, moving across the columns with each cell) - the 2nd through 8th cells function fine. The dialog box pops up, the rating can be selected. it's just the FIRST cell that gives the issue What would possibly be the cause of this? We need users of this form to be able to save, close, and re-open it if needed.