RIBBON CODE: Imports ExcelApplication Imports Microsoft.Office.Interop.Excel Imports Microsoft.Office.Tools.Ribbon Public Class Ribbon1 Dim UserForm As frmUserCreate Private Sub Ribbon1_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load End Sub Private Sub btnAddUser_Click(sender As Object, e As RibbonControlEventArgs) Handles btnAddUser.Click UserForm = New frmUserCreate UserForm.Show() End Sub USER FORM CODE: Public Class frmUserCreate Private ReadOnly Application As Object Dim WrkSht As Users Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click Me.Close() End Sub Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click Me.Close() End Sub Private Sub frmUserCreate_Load(sender As Object, e As EventArgs) Handles MyBase.Load CType(Application.ActiveWorkbook.Sheets(1), Excel.Worksheet).Select() End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)