Hello,
In 2010 forum user vog wrote me a brilliant piece of code that I have used for 12 years with no problems. I switched to open odffice and the fun all began. Maybe they are not compatible? Here is some of the macros that do not work. Can anyone show any light on the situation.
Module 1 Insert Checkboxes
When I run this macro I get the following error, please see picture below.
In 2010 forum user vog wrote me a brilliant piece of code that I have used for 12 years with no problems. I switched to open odffice and the fun all began. Maybe they are not compatible? Here is some of the macros that do not work. Can anyone show any light on the situation.
Module 1 Insert Checkboxes
Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Option Explicit
Sub insertCheckboxes()
Dim myBox As CheckBox
Dim myCell As Range
Dim cellRange As String
Dim cboxLabel As String
Dim linkedColumn As String
cellRange = InputBox(Prompt:="Cell Range", _
Title:="Cell Range")
linkedColumn = InputBox(Prompt:="Linked Column", _
Title:="Linked Column")
cboxLabel = InputBox(Prompt:="Checkbox Label", _
Title:="Checkbox Label")
With ActiveSheet
For Each myCell In .Range(cellRange).Cells
With myCell
Set myBox = .Parent.CheckBoxes.Add(Top:=.Top, _
Width:=.Width, Left:=.Left, Height:=.Height)
With myBox
.LinkedCell = linkedColumn & myCell.Row
.Caption = cboxLabel
.Name = "checkbox_" & myCell.Address(0, 0)
End With
.NumberFormat = ";;;"
End With
Next myCell
End With
End Sub
When I run this macro I get the following error, please see picture below.
Last edited by a moderator: