Solved

Excel - Range.Hidden property

Posted on 2001-07-30
6
787 Views
Last Modified: 2013-11-25
Hello,
I have got a problem with use of Range.Hidden property:
I put the ActiveX CheckBox on my sheet and assigned following procedure:

Private Sub CheckBox1_Click()
    Columns(10).Value = "Abracadabra"
    Columns(10).Hidden = True    
End Sub

The first line is OK (All fields in the Column No.10 are filled with "Abracadabra") whereas the second one fail (Error 1004).

Note that if I put these two lines for instance in Worksheet_Change event, everything is OK.

Regards,
Vladimir
0
Comment
Question by:vnej4304
  • 4
  • 2
6 Comments
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6334140
This will help:
Private Sub CheckBox1_Click()
   Columns(1).Value = "Abracadabra"
   Application.ActiveCell.Select
   Columns(1).Hidden = True
End Sub

You must set the focus to the excel sheet back from
the checkbox ..
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6334170
You must reset the focus from the ActiveX  Checkbox
to the Excel Worksheet object.

This is probably an old excel bug ...

(This error irritates me really long)
WoK
0
 
LVL 4

Accepted Solution

by:
WolfgangKoenig earned 300 total points
ID: 6334196
Beside there exists more errors with ole objects in Excel.
For instance when you embed an command button to the worksheet an then adjust your screen resolution, then it can happen that the behavior of the buttons are crazy. They will resize their font and size randomly ...

More complex an application more bugs they have.

WoK
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:vnej4304
ID: 6334220
Thank you VERY much for your quick and comprehensive answer.
Have a great day!
Vladimir Nejedly
0
 

Author Comment

by:vnej4304
ID: 6334224
Thank you VERY much for your quick and comprehensive answer.
Have a great day!
Vladimir Nejedly
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6334230
Best regards;o)
WoK
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now