![]() |
Trouble with ActiveControls and Forms
Hello I have a Option Button (from forms) with a Macro Attached to it that changes the values of a combobox (also from Forms). Here is the code i am using: Code: -------------------- Sub OpcionCero() ' Boton para Seleccion de Opcion Cotizacion Activa ' Macro recorded 1/5/2005 by jose luis ' Application.ScreenUpdating = False ActiveSheet.Shapes("Drop Down 428").Select With Selection .ListFillRange = "$P$2" 'Letrero Cotizacion Actual .LinkedCell = "$L$40" .DropDownLines = 1 .Display3DShading = True End With Range("A2").Select Sheets("ADM_SYS").Range("NumeroCotizacion") = " " Application.ScreenUpdating = True End Sub -------------------- My problems araise when i protect the sheet. Cause the application crashes. I tried with ActiveControls but i haven't been able enough to make it run. Any help on how to proceed will be welcomed, Thanks in advance Regards Jose Luis -- jose luis ------------------------------------------------------------------------ jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312 View this thread: http://www.excelforum.com/showthread...hreadid=380998 |
Trouble with ActiveControls and Forms
Saludos Jose Luis,
I think you need to unprotect the sheet at the start, and protect it again at the end. Look up protect and unprotect in help. Why would you use a combobox with only one item? -- HTH RP (remove nothere from the email address if mailing direct) "jose luis" wrote in message ... Hello I have a Option Button (from forms) with a Macro Attached to it that changes the values of a combobox (also from Forms). Here is the code i am using: Code: -------------------- Sub OpcionCero() ' Boton para Seleccion de Opcion Cotizacion Activa ' Macro recorded 1/5/2005 by jose luis ' Application.ScreenUpdating = False ActiveSheet.Shapes("Drop Down 428").Select With Selection .ListFillRange = "$P$2" 'Letrero Cotizacion Actual .LinkedCell = "$L$40" .DropDownLines = 1 .Display3DShading = True End With Range("A2").Select Sheets("ADM_SYS").Range("NumeroCotizacion") = " " Application.ScreenUpdating = True End Sub -------------------- My problems araise when i protect the sheet. Cause the application crashes. I tried with ActiveControls but i haven't been able enough to make it run. Any help on how to proceed will be welcomed, Thanks in advance Regards Jose Luis -- jose luis ------------------------------------------------------------------------ jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312 View this thread: http://www.excelforum.com/showthread...hreadid=380998 |
Trouble with ActiveControls and Forms
Thank you for answering Bob. What really happens is that I 'm building a small application that i want to be shared, therefore i'm changing all the xyz.select instructions for avoid the application from crashing when shared. In this particular code, depending on wich option button is selected, a macro is run to change the text of the ComboBox to show just "None" without more posible entries. Later when the user chooses "option button 2", another macro runs to change the .ListFillRange= "Historia!A4:A1500" and .DropDownLines to 10 Here is the code i'm using for the second macro: Code: -------------------- Application.ScreenUpdating = False 'DesprotegeHoja ActiveSheet.Shapes("Drop Down 428").Select With Selection .ListFillRange = "Historia!A4:A1500" .LinkedCell = "$L$40" .DropDownLines = 10 .Display3DShading = True End With Range("A2").Select Sheets("ADM_SYS").Range("NumeroCotizacion") = " " 'ProtegeHoja Application.ScreenUpdating = True End Sub -------------------- My problem is how to run this macro changing the lines : Code: -------------------- ActiveSheet.Shapes("Drop Down 428").Select With Selection .ListFillRange = "Historia!A4:A1500" .LinkedCell = "$L$40" .DropDownLines = 10 .Display3DShading = True End With -------------------- with something like: Code: -------------------- ActiveSheet.Shapes("Drop Down 428").ListFillRange = "Historia!A4:A1500" ActiveSheet.Shapes("Drop Down 428").LinkedCell = "$L$40" ActiveSheet.Shapes("Drop Down 428").DropDownLines = 10 ActiveSheet.Shapes("Drop Down 428").Display3DShading = True -------------------- I have tried that with no luck. Hope I explain it clear enough for you to give a hand with this :confused: I would like to understand why my proposed solution don't works. Thank you so much Bob. Regards Jose Luis Bob Phillips Wrote: Saludos Jose Luis, I think you need to unprotect the sheet at the start, and protect it again at the end. Look up protect and unprotect in help. Why would you use a combobox with only one item? -- HTH RP (remove nothere from the email address if mailing direct) "jose luis" wrote in message ... Hello I have a Option Button (from forms) with a Macro Attached to it that changes the values of a combobox (also from Forms). Here is the code i am using: Code: -------------------- Sub OpcionCero() ' Boton para Seleccion de Opcion Cotizacion Activa ' Macro recorded 1/5/2005 by jose luis ' Application.ScreenUpdating = False ActiveSheet.Shapes("Drop Down 428").Select With Selection .ListFillRange = "$P$2" 'Letrero Cotizacion Actual .LinkedCell = "$L$40" .DropDownLines = 1 .Display3DShading = True End With Range("A2").Select Sheets("ADM_SYS").Range("NumeroCotizacion") = " " Application.ScreenUpdating = True End Sub -------------------- My problems araise when i protect the sheet. Cause the application crashes. I tried with ActiveControls but i haven't been able enough to make it run. Any help on how to proceed will be welcomed, Thanks in advance Regards Jose Luis -- jose luis ------------------------------------------------------------------------ jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312 View this thread: http://www.excelforum.com/showthread...hreadid=380998 -- jose luis ------------------------------------------------------------------------ jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312 View this thread: http://www.excelforum.com/showthread...hreadid=380998 |
All times are GMT +1. The time now is 11:46 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com