1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Compile Error: Duplicate declaration in current scope in Oracle Web ADI Layout?

Discussion in 'Oracle CRM' started by katarukoti, Jul 24, 2012.

  1. katarukoti

    katarukoti Guest

    Dear Experts,

    please help me on the following error

    i am using Oracle R12 Web Template Adi Layout

    i am defining two functions in my Layout and proceed for further action

    i got the below error, when the excel sheet opens

    Microsoft Visual Basic Compile Error: Duplicate declaration in current scope

    Generated Code looks like:

    Public Sub ApplyFormulasToSheet(objSheet As Worksheet)
    On Error Resume Next
    Dim objRange As Range
    Application.EnableEvents = False
    objSheet.Unprotect
    Set objRange = objSheet.Range(“MAIN_P_LINELOC_QTY”)
    Dim formulaStr As String
    formulaStr = “=MAIN_P_LINEQTY”
    objRange.Formula = formulaStr
    If objSheet.name = “Actual” Then
    Dim c As Range
    For Each c In objRange
    c.FormulaLocal = c.text
    Next c
    End If
    Set objRange = objSheet.Range(“MAIN_P_DIST_QTY”)
    Dim formulaStr As String
    formulaStr = “=MAIN_P_LINEQTY”
    objRange.Formula = formulaStr
    If objSheet.name = “Actual” Then
    Dim c As Range
    For Each c In objRange
    c.FormulaLocal = c.text
    Next c
    End If
    Application.EnableEvents = True
    objSheet.Protect
    End Sub

    please help me on defining more than 1 Formula in OracleR12 Adi Layout Template

    Thanks in Advance,
    Koti.
     
  2. Ramji

    Ramji Forum Guru

    Messages:
    525
    Likes Received:
    177
    Trophy Points:
    1,505
    Location:
    Nomad
    Kindly upload the template plus screen shots and what you are trying to do. I shall try to take a look shortly.
    Ramji