Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Could not load object library error in .xls file

Status
Not open for further replies.
Jan 22, 2003
92
0
0
US
Here it the code I am having problems with. Could someone tell me why it is giving me this error message.
Public Sub CmdbarDeinit()
On Error Resume Next
Set CmdBar = GetCommandBar
If Not CmdBar Is Nothing Then
CmdBar.Delete
Set CmdBar = Nothing
End If
End Sub

-------------
Public Sub CmdbarInit()
Dim CmdBarCtrl As CommandBarButton
CmdbarDeinit
Set CmdBar = Application.CommandBars.Add(ToolTitle, msoBarTop, False, True)
CmdBar.Visible = True

Set CmdBarCtrl = CmdBar.Controls.Add(msoControlButton, , , , True)
If Language = deutsch Then
CmdBarCtrl.Caption = "Import Annex3 Altbestand..."
Else
CmdBarCtrl.Caption = "Import Annex3 legacy data..."
End If
CmdBarCtrl.OnAction = "SoaImport"
CmdBarCtrl.Style = msoButtonIconAndCaption
CmdBarCtrl.FaceId = 23

Set CmdBarCtrl = CmdBar.Controls.Add(msoControlButton, , , , True)
If Language = deutsch Then
CmdBarCtrl.Caption = "Bearbeiten Relevanz..."
Else
CmdBarCtrl.Caption = "Edit relevance..."
End If
CmdBarCtrl.OnAction = "SoaEdit"
CmdBarCtrl.Style = msoButtonIconAndCaption
CmdBarCtrl.FaceId = 586

Set CmdBarCtrl = CmdBar.Controls.Add(msoControlButton, , , , True)
If Language = deutsch Then
CmdBarCtrl.Caption = "Export Annex3 als CSV..."
Else
CmdBarCtrl.Caption = "Export Annex3 to CSV..."
End If
CmdBarCtrl.OnAction = "SoaExport"
CmdBarCtrl.Style = msoButtonIconAndCaption
CmdBarCtrl.FaceId = 3

Set CmdBarCtrl = Nothing
End Sub

-----------
Public Sub CmdbarSetLang()
Dim CmdBarCtrl As CommandBarButton
Set CmdBar = GetCommandBar
If Not CmdBar Is Nothing Then
If Language = "deutsch" Then
CmdBar.Controls(CbIndexExport).Caption = "Export Annex3 als CSV..."
CmdBar.Controls(CbIndexEdit).Caption = "Bearbeiten Relevanz..."
CmdBar.Controls(CbIndexImport).Caption = "Import Annex3 Altbestand..."
Else
CmdBar.Controls(CbIndexExport).Caption = "Export Annex3 to CSV..."
CmdBar.Controls(CbIndexEdit).Caption = "Edit relevance..."
CmdBar.Controls(CbIndexImport).Caption = "Import Annex3 legacy data..."
End If
End If
End Sub

-----------
Public Sub SoaEdit()
Dim ws As Worksheet
Dim row As Long
Dim sr As SoaRelevanz

If Not CheckIsAnnex3Sheet Then Exit Sub

On Error Resume Next
Set ws = Application.ActiveWorkbook.Sheets(SheetAnnex3)
If Not ws Is Nothing Then
row = Application.ActiveCell.row
If row > RowHead Then
sr = SrGetData(ws, row)
dlgSoaRelevanz.EditSoa sr
If dlgSoaRelevanz.exitok Then
If Not SrSetData(ws, row, sr) Then
If Language = "deutsch" Then
MsgBox "Bei der Rückübertragung der Daten ist ein Fehler aufgetreten.", vbOKOnly, ToolTitle
Else
MsgBox "An error occured during transfer of data.", vbOKOnly, ToolTitle
End If
End If
End If
End If
Else
If Language = "deutsch" Then
MsgBox "Für diese Funktion müssen Sie sich in einem SOX-ImportMaster befinden.", vbOKOnly, ToolTitle
Else
MsgBox "Please activate a SOX-ImportMaster first.", vbOKOnly, ToolTitle
End If
End If
End Sub

-----------
Public Sub SoaExport()
Dim filename As String

filename = AskFilenameExport
If filename <> "" Then
If Not SoaWriteCSV(Application.ActiveWorkbook.Sheets(SheetAnnex3), filename) Then
MsgBox "Beim CSV-Export des Annex3 ist ein Fehler aufgetreten.", vbOKOnly, ToolTitle
End If
End If

End Sub

-----------
Public Sub SoaImport()
Dim filename As String
If Len(Application.ActiveWorkbook.Sheets(SheetAnnex3).Cells(RowHead + 1, ColRiskGuid).Value) > 0 Then
If Language = "deutsch" Then
MsgBox "Dieser ImportMaster enthält bereits Annex3-Daten." & vbCrLf & "Aus Sicherheitsgründen ist das Importieren nur in leere Annex3 erlaubt (Überschreibung)." & vbCrLf & "Bitte leeren Sie diesen ImportMaster vor dem Import.", vbOKOnly, ToolTitle
Else
MsgBox "This ImportMaster already contains Annex3 data." & vbCrLf & "For security reasons, it is only allowed to import into an empty ImportMaster (risk of overwriting)." & vbCrLf & "Please clear the ImportMaster before you try to import.", vbOKOnly, ToolTitle
End If
Exit Sub
End If
filename = AskFilenameImport
If Len(filename) > 0 Then
If Application.ActiveWorkbook.Name = NameFromFullname(filename) Then
If Language = "deutsch" Then
MsgBox "Dateiname des aktiven Ziel-ImportMasters und des ausgewählten Quell-ImportMasters dürfen nicht identisch sein." & vbCrLf & "Bitte stellen Sie sicher, dass beide Dateien verschiedene Namen tragen.", vbOKOnly, ToolTitle
Else
MsgBox "Filename of the current Target-ImportMaster and the selected Source-ImportMaster must be different." & vbCrLf & "Please rename one of the files.", vbOKOnly, ToolTitle
End If
Else
If Not SoaReadFile(filename) Then
If Language = "deutsch" Then
MsgBox "Während des Imports sind Fehler aufgetreten.", vbOKOnly, ToolTitle
Else
MsgBox "One or more errors occured during import.", vbOKOnly, ToolTitle
End If
End If
CmdbarInit
End If
End If
End Sub

Thanks in advance especially for quit replies :)
 
wfairbanks,

1) this is the MS Office forum. Your question should be posted in the VBA Forum707.

2) You have posted a phonebook's worth of code without any indication of what statement is causing you problems. In addition, you refer to an error message. What is it?

Help yourself out by including the information that only a clarvoyant could devine, unless it were explicitly stated.

Skip,
[sub]
[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top