If this is your first visit, be sure to
check out the
FAQ
by clicking the
link above. You may have to
register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Hi there,
I've just started learning VB.NET. I have gone through a number of full course video tutorial and I'm now trying my first programing project. I'm fairly experienced with VBA and want to transition to Vb.NET en-route to C#.
I'm working on an Excel VSTO Addin project attached
Now, on this Add-in if a user clicks on the Login button a form called fmaLogin must popup requesting user log in details.
The login details entered will then be compare to the ones stored in an SQL CE database before the Add-in opens a specific Excel workbook and perform some automated actions in VBA.
The part I currently need your help is how to call the fmaLogin form by clicking the Login button. The code I current have is shown below.
Code:
Imports Microsoft.Office.Tools.Ribbon
Imports Microsoft.Office.Interop.Excel
Public Class FinShotsRibbon
Private Sub FinShotsRibbon_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load
End Sub
Private Sub btnLogin_Click(sender As Object, e As RibbonControlEventArgs) Handles btnLogin.Click
Dim ActiveWorkSheet As Microsoft.Office.Interop.Excel.Worksheet =
Globals.ThisAddIn.Application.ActiveWorkbook.Worksheets(1)
Dim Worksheet As Microsoft.Office.Tools.Excel.Worksheet =
Globals.Factory.GetVstoObject(ActiveWorkSheet)
Worksheet.Range("A1").Value = Environment.UserName
fmaLogin.Show()
End Sub
Private Sub tgglFyCy_Click(sender As Object, e As RibbonControlEventArgs) Handles tgglFyCy.Click
If Me.tgglFyCy.Label = "Calendar Year" Then
Me.tgglFyCy.Label = "Financial Year"
Me.cmbRY.Label = "Financial Year"
ElseIf tgglFyCy.Label = "Financial Year" Then
Me.tgglFyCy.Label = "Calendar Year"
Me.cmbRY.Label = "Calendar Year"
End If
End Sub
Private Sub tgglReportOrder_Click(sender As Object, e As RibbonControlEventArgs) Handles tgglReportOrder.Click
If Me.tgglReportOrder.Label = "Oldest to Current" Then
Me.tgglReportOrder.Label = "Current to Oldest"
ElseIf tgglReportOrder.Label = "Current to Oldest" Then
Me.tgglReportOrder.Label = "Oldest to Current"
End If
End Sub
End Class
The code in bold not working for me how do I do it right.
Thanks,
Mooste
Advertiser Disclosure:
Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.