Friday, August 5, 2011

Adding Custom Menus In Excel :

If You want to add Custom Manus in Excel you can Write a program like this :



Private Sub Workbook_Open()
If Application.Version >= 12 Then
On Error Resume Next
Dim Cbar As CommandBar


Set Cbar = Application.CommandBars.Add
With Cbar
.Name = "EB_Pro(Version.0.1)"
.Visible = True
.Position = msoBarTop
End With


With Cbar.Controls.Add(msoControlButton)
.Caption = "&DownLoadBill"
.Style = msoButtonCaption
.OnAction = "Module1.DownloadBills"
.Visible = True
.BeginGroup = True
End With




With Cbar.Controls.Add(msoControlButton)
.Caption = "&DownloadPayMent" & vbCrLf & "History"
.Style = msoButtonCaption
.OnAction = "PaymentHistory.DownloadHistory"
.Visible = True
.BeginGroup = True
End With

End Sub

No comments: