Hallo,
nachdem ich mich jetzt Tagelang mit einem Excel-Projekt abgemüht habe, hat mir mein Chef heute mitgeteilt, dass er doch lieber auf OpenOffice umsteigen möchte.
Daher muss ich jetzt meine VBA-Makros nach SB konvertieren und habe keine Ahnung wie das gehen soll.
Hier mal eine erste Frage:
Dim x
x = Cells(3, 2)
Dim y
y = Cells(3, 4)
Workbooks.Open (ThisWorkbook.Path & Application.PathSeparator & „documentos-adicionais“ & „“ & „checklist.xls“)
Sheets(„anexos“).Range(„A2“).Value = y
If y = „RADIADORES“ Then
Sheets(„radiadores“).Range(„E3“).Value = x
Sheets(„radiadores“).Range(„E4“).Value = y
ActiveWorkbook.SaveAs (ActiveWorkbook.Path & Application.PathSeparator & „…\clientes“ & „“ & x & „-“ & y & „.xls“)
Windows(„calcular-encomenda.xls“).Activate
ActiveWindow.Close savechanges:=False
ElseIf y = „BIOMASSA“ Or y = „BOMBA CALOR“ Then
Sheets(„fonte“).Range(„E3“).Value = x
Sheets(„fonte“).Range(„E4“).Value = y
ActiveWorkbook.SaveAs (ActiveWorkbook.Path & Application.PathSeparator & „…\clientes“ & „“ & x & „-“ & y & „.xls“)
Sheets(„fonte“).Select
Windows(„calcular-encomenda.xls“).Activate
ActiveWindow.Close savechanges:=False
Else
MsgBox „Escolha o tipo de encomenda, por favor!“
End If
End Sub
Das möchte ich gerne nach SB konvertieren. FAngen wir mal klein an. Ich kriege schon nicht das Dokument
Workbooks.Open (ThisWorkbook.Path & Application.PathSeparator & „documentos-adicionais“ & „“ & „checklist.xls“) geöffnet.
Aus einem Forum hab ich mir folgenden Code stibitzt:
Sub MyProc
Dim DirectoryName as String
Dim NewWorkbook as Object
Dim NoArgs() 'empty array for no arguments
Rem Assume DirectoryName variable contains directory
Rem location of the currently active workbook
NewWorkbook = StarDesktop.loadComponentFromURL _
(„file:///“ & DirectoryName & „/2.sxc“, _
„_blank“,0 ,NoArgs() )
End Sub
Da sagt mir Calc aber beim konvertieren: URL seems to be an unsupported one.
Hat jemand eine Ahnung woran das liegt?
David