• 締切済み

めっちゃ困ってます

ソフトを使おうとしたのですがいきなりつまづきました。11行目の◎◎のところがまちがってる?という事らしいのですが、どなたかどうしたらなおるか教えていただけないでしょうか。 Sub MortalityMenu() DeleteMort Dim MortMenu As CommandBarControl Dim MainMenu As CommandBar Dim SecondMenu As CommandBarControl Dim HelpIndex As Integer Dim NewButton As CommandBarControl Dim IconSheet As Worksheet 'Set IconSheet = Worksheets("Sheet5") Set MainMenu = Application.CommandBars("Worksheet Menu Bar") ◎HelpIndex = MainMenu.Controls("Help").Index◎ Set MortMenu = MainMenu.Controls.Add(Type:=msoControlPopup, _ Before:=HelpIndex) MortMenu.Caption = "&Mortality" Set SecondMenu = MortMenu.Controls.Add(Type:=msoControlPopup) SecondMenu.Caption = "&P-spline" Set NewButton = SecondMenu.Controls.Add(Type:=msoControlButton) With NewButton .Caption = "Fit Model" .Style = msoButtonIconAndCaption .OnAction = "Graduation.RunPS" End With Set NewButton = SecondMenu.Controls.Add(Type:=msoControlButton) With NewButton .Caption = "Generate Scenario" .Style = msoButtonIconAndCaption .OnAction = "Graduation.AddScenPS" End With Set SecondMenu = MortMenu.Controls.Add(Type:=msoControlPopup) SecondMenu.Caption = "&Lee-Carter" Set NewButton = SecondMenu.Controls.Add(Type:=msoControlButton) With NewButton .Caption = "Fit Model" .Style = msoButtonIconAndCaption .OnAction = "Graduation.RunLC" End With Set NewButton = SecondMenu.Controls.Add(Type:=msoControlButton) With NewButton .Caption = "Generate Scenario" .Style = msoButtonIconAndCaption .OnAction = "Graduation.RunLCProjection" End With ' Set SecondMenu = MortMenu.Controls.Add(Type:=msoControlButton) ' SecondMenu.Caption = "&Add Mortality Data" ' SecondMenu.OnAction = "AddData.AddMortalitySheets" Set SecondMenu = MortMenu.Controls.Add(Type:=msoControlButton) SecondMenu.Caption = "&About CMI Software" SecondMenu.OnAction = "Graduation.ShowAbout" End Sub Sub DeleteMort() On Error Resume Next CommandBars(1).Controls("Mortality").Delete End Sub

みんなの回答

  • keirika
  • ベストアンサー率42% (279/658)
回答No.1

HelpIndex = MainMenu.Controls("ヘルプ(H)").Index でどうでしょうか。 EXCEL2003の日本語版を使用

harujion96
質問者

お礼

解答ありがとうございます! 早速ためしてみたらOKでした! ほんとうにありがとうございました☆

関連するQ&A

専門家に質問してみよう