hopelessliar
Technical User
I have been provided with an excel sheet that allows me to upload to a database. It's very useful and I thought I could adapt it to upload other pieces of information. So I took a look at the code that was doing this and I cannot fathom it at all. Can anyone give me any pointers here?
2 scripts:
Private Sub Workbook_Open()
Dim cbrStandard As CommandBar
Dim mnuNewMenu As CommandBarControl
Dim cmdNewCtrl As CommandBarButton
Set cbrStandard = Application.CommandBars.ActiveMenuBar
Set mnuNewMenu = cbrStandard.FindControl(, , "DDS"
If Not mnuNewMenu Is Nothing Then Exit Sub
Set mnuNewMenu = cbrStandard.Controls.Add(Type:=msoControlPopup, Temporary:=True)
mnuNewMenu.Caption = "DDS O&ptions"
mnuNewMenu.Tag = "DDS"
Set cmdNewCtrl = mnuNewMenu.Controls.Add(Type:=msoControlButton, Id:=1)
cmdNewCtrl.Caption = "&Upload CPT Scheme"
cmdNewCtrl.TooltipText = "Upload CPT Scheme to DDS Server"
cmdNewCtrl.Style = msoButtonCaption
cmdNewCtrl.OnAction = "DDSCPTUpload"
End Sub
and then this module:
Public Sub DDSCPTUpload()
'
' DDSCPTUpload Macro for Excel 97
'
Dim objDDSCPTUpload As Object
Set objDDSCPTUpload = CreateObject("DDSCPTUpload.clsCPTUploadUI"
objDDSCPTUpload.Start Application
Set objDDSCPTUpload = Nothing
End Sub
I'm no VBA expert but I can usually follow what's happening enough to make modifications, this has me mystified.
2 scripts:
Private Sub Workbook_Open()
Dim cbrStandard As CommandBar
Dim mnuNewMenu As CommandBarControl
Dim cmdNewCtrl As CommandBarButton
Set cbrStandard = Application.CommandBars.ActiveMenuBar
Set mnuNewMenu = cbrStandard.FindControl(, , "DDS"
If Not mnuNewMenu Is Nothing Then Exit Sub
Set mnuNewMenu = cbrStandard.Controls.Add(Type:=msoControlPopup, Temporary:=True)
mnuNewMenu.Caption = "DDS O&ptions"
mnuNewMenu.Tag = "DDS"
Set cmdNewCtrl = mnuNewMenu.Controls.Add(Type:=msoControlButton, Id:=1)
cmdNewCtrl.Caption = "&Upload CPT Scheme"
cmdNewCtrl.TooltipText = "Upload CPT Scheme to DDS Server"
cmdNewCtrl.Style = msoButtonCaption
cmdNewCtrl.OnAction = "DDSCPTUpload"
End Sub
and then this module:
Public Sub DDSCPTUpload()
'
' DDSCPTUpload Macro for Excel 97
'
Dim objDDSCPTUpload As Object
Set objDDSCPTUpload = CreateObject("DDSCPTUpload.clsCPTUploadUI"
objDDSCPTUpload.Start Application
Set objDDSCPTUpload = Nothing
End Sub
I'm no VBA expert but I can usually follow what's happening enough to make modifications, this has me mystified.