#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 - error saving file & error loading dll TinaF Excel Discussion (Misc queries) 0 July 1st 09 01:49 PM
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 08:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"