VBAで以前はテキストボックスの背景が透明(塗潰しなし)で入力できていたのですが
気が付けば、背景色が透明でなく、白塗潰しで入力されるようになりました。
問題が発生しているのは
OS:Windows 10 Pro 64 ビット
Excel Microsoft 365 MSO (バージョン 2111 ビルド 16.0.14701.20204) 32 ビット
現在でも古いPCのExcel2013では背景が透明(塗潰しなし)で入力できてます。
Excelのバージョンに由来する挙動なのでしょうか?
設定しているVBAを下記に記載しておきます。
Sub 文字挿入単体()
tatehaba1 = ActiveCell.Height
Yokohaba = Selection.Width
Tatehaba = Selection.Height
Yoko = Selection.Left
Takasa = Selection.Top
Migihashi = Yoko + Yokohaba + Futosa \ 2
Hidarihashi = Yoko - Futosa \ 2
Shita = Takasa + Tatehaba
Migi = Yoko + Yokohaba
inptxt = InputBox("文字を入力してください", 文字入力)
If inptxt = "" Then
Exit Sub
End If
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, _
Yoko + 2, Takasa - 2, 0, 0).Select
Selection.Characters.Text = inptxt
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoFalse
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.Orientation = xlHorizontal
.AutoSize = True
.AddIndent = False
End With
End Sub