Solved

Excel - Range.Hidden property

Posted on 2001-07-30
6
791 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

776 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