PDA

View Full Version : Sleeper: Excel 2003 Convert to 2007 xlsm file



houch
04-28-2008, 07:12 AM
When I convert a 2003 file to 2007 file via "Convert" or "Save As", my ActiveX Control names are renamed to the default. For example in Excel 2003 the default for Activex command control is "CommandButton1", but I set the property name to "cmd_load_source_data" to distinquish from other Activex controls. The 2007 conversion changes the control back to "CommandButton1", so the controls are disconnected from the VBA code (see below).


Private Sub cmd_load_source_data_Click()
Call Module1.get_data
End Sub

Private Sub CommandButton1_Click()

End Sub

If I had used Form Controls instead of ActiveX controls, the conversion would be fine. It appears I will need to touch each Excel file before conversion. Any alternatives would be appreciated.

Oorang
04-28-2008, 10:48 AM
This is just as idea, I haven't tested it: In the original version, write a procedure to loop through every form and it's controls and place the control name in the tag property. Then convert the file and run a another procedure to rename every control to the value of it's tag property and recompile.

houch
04-29-2008, 10:03 AM
Good idea on use of tags. I will let you know how it turns out.