?
Solved

Excel - Range.Hidden property

Posted on 2001-07-30
6
Medium Priority
?
804 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1200 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

800 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