Forum FlexPro – Discuss your topic!

CopyTo Methode

Accueil > Community > Automation and VBA > CopyTo Methode

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12418
    Dennis ReichenbachDennis Reichenbach
    Participant

    Hallo,

    ich möchte die CopyTo Methode verwenden um eine Formel im RootFolder der aktiven Datenbank zu kopieren und unter einem anderen Namen einzufügen.
    Ich habe es mit folgendem Code versucht, bekomme aber immer eine Fehlermeldung.

    Sub Test()
    Dim Verluste_LL As Formula

    Set Verluste_LL = ActiveDatabase.RootFolder.Object(“05_1_Verschiebung_V_LL”, fpObjectTypeFormula)
    Verluste_LL.CopyTo (ActiveDatabase.RootFolder)

    Set Verluste_LL = Nothing
    End Sub

    Können Sie mir weiter helfen?

    #8099
    Dennis ReichenbachDennis Reichenbach
    Participant

    Hallo,

    ich möchte die CopyTo Methode verwenden um eine Formel im RootFolder der aktiven Datenbank zu kopieren und unter einem anderen Namen einzufügen.
    Ich habe es mit folgendem Code versucht, bekomme aber immer eine Fehlermeldung.

    Sub Test()
    Dim Verluste_LL As Formula

    Set Verluste_LL = ActiveDatabase.RootFolder.Object(“05_1_Verschiebung_V_LL”, fpObjectTypeFormula)
    Verluste_LL.CopyTo (ActiveDatabase.RootFolder)

    Set Verluste_LL = Nothing
    End Sub

    Können Sie mir weiter helfen?

    #8684
    Bernhard KantzBernhard Kantz
    Participant

    If you use a method in VBA without an assignment you have to remove the brackets.

    This is not possible in VBA:

    
    Verluste_LL.CopyTo(ActiveDatabase.RootFolder)
    

    This code is correct:

    
    Verluste_LL.CopyTo ActiveDatabase.RootFolder
    

    or

    
    Dim oDestination As Formula
    Set oDestination = Verluste_LL.CopyTo(ActiveDatabase.RootFolder)
    

    support@weisang.com

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.