Skip navigation

Account settings

Topic

CopyTo Methode

Home page Community Automation and VBA CopyTo method

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #34959
    Dennis 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?

    #34961
    Dennis 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?

    #34960
    Bernhard Kantz
    Participant

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

    This is not possible in VBA:
    [code]
    Verluste_LL.CopyTo(ActiveDatabase.RootFolder)
    [/code]

    This code is correct:
    [code]
    Verluste_LL.CopyTo ActiveDatabase.RootFolder
    [/code]
    or
    [code]
    Dim oDestination As Formula
    Set oDestination = Verluste_LL.CopyTo(ActiveDatabase.RootFolder)
    [/code]

    support@weisang.com

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