Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel error
I have been writing an excel/vba application and have run
into problems when making changes. On start up I present a form to the user to choose how they would like to input data, according to the choice the spreadsheet displays cells in a certain way. Inevitably the requirements have changed so that the input choices can be made at any time, not only on start up. Basically the code now fails when I hook it up to on sheet buttons. Why would this be? Presumably some initialisation problem that I have overlooked? Code examples....from the form - these methods fail if I move them to buttons on the sheet itself. Private Sub TenInputsOptionButton_Click() InitialisationModle.alterSheetTenInputs End Sub Private Sub ThreeInputOptionButton_Click() InitialisationModule.alterSheetThreeInputs End Sub ....and this is the specific code that falls over 'reveals an area of cells that was previously hidden 'the previous font and interior colours are restored 'Rng is an object that specifies the Range of cells that will be affected 'Default_Value is an integer or double specifies the default value of the cells Private Sub Reveal_Cells(Rng As Range, Default_Value As Variant) Rng.Interior.ColorIndex = 19 Rng.Font.ColorIndex = 5 Rng.Value = Default_Value End Sub ---------------------------------------------------------- advice welcome Steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel error
Try removing the Private and see if it resolves.
-- Regards, Tom Ogilvy "Steve" wrote in message ... I have been writing an excel/vba application and have run into problems when making changes. On start up I present a form to the user to choose how they would like to input data, according to the choice the spreadsheet displays cells in a certain way. Inevitably the requirements have changed so that the input choices can be made at any time, not only on start up. Basically the code now fails when I hook it up to on sheet buttons. Why would this be? Presumably some initialisation problem that I have overlooked? Code examples....from the form - these methods fail if I move them to buttons on the sheet itself. Private Sub TenInputsOptionButton_Click() InitialisationModle.alterSheetTenInputs End Sub Private Sub ThreeInputOptionButton_Click() InitialisationModule.alterSheetThreeInputs End Sub ...and this is the specific code that falls over 'reveals an area of cells that was previously hidden 'the previous font and interior colours are restored 'Rng is an object that specifies the Range of cells that will be affected 'Default_Value is an integer or double specifies the default value of the cells Private Sub Reveal_Cells(Rng As Range, Default_Value As Variant) Rng.Interior.ColorIndex = 19 Rng.Font.ColorIndex = 5 Rng.Value = Default_Value End Sub ---------------------------------------------------------- advice welcome Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 - error saving file & error loading dll | Excel Discussion (Misc queries) | |||
Error: "Excel encountered an error and had to remove some formatti | Excel Discussion (Misc queries) | |||
Counting instances of found text (Excel error? Or user error?) | Excel Worksheet Functions | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |