Execute Excel Macro Through DIAdem

Hi All,
  I am currently trying to run a script in DIAdem which exports certain material properties to an Excel Macro-enabled workbook.  Inside the Excel workbook the user executes a macro to perform some calculations.  The results of that calculation will then be re-imported into a DIAdem report.  I have the import/export data part down, but the million dollar question is how can I execute an Excel macro from DIAdem's VBScript?
  I know some are going to say this makes no sense, just do the calculation in DIAdem.  I know this, but the file/calculations are an industry accepted toolbox and it must be done this way. 
  Thanks in advance and here is some dumbed down code to showcase the example:
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim excel
Dim excelbook
Dim a
Set Excel = CreateObject("Excel.Application")
Excel.Visible = True
Set excelbook=Excel.Workbooks.Open("My File")
excelbook.Sheets("InputResults").range("B5").value = Data.Root.ChannelGroups(ChanGrp#).Properties("myProp").Value
'Call 'My_Macro' !!!!!!!!!!!!!!!!!!!!
Msgbox("Result is: " & excelbook.Sheets("InputResults").range("B5").value)
Solved!
Go to Solution.

Hi GT_Mark
You simply can use the methode Run
Call Excel.Run("MyMacro")
Of course you have to make sure that you refer only to data that are available in Excel.
To obtain CodeCompletion for Excel in the script editor select Microsoft Excel x.x Objects Library in the "Registed Type Libraries" dialog box. The x.x value depends on your installed Excel version.  To open this dialog box, select Script»Type Libraries in DIAdem SCRIPT.
Hope this helps
Winfried

Similar Messages

  • Executing Excel Macros from SAP

    Hi all Experts,
    I have created a program which tranfers data from different internal tables into Different Worksheets of a single workbook.
    Now, Can some one please tell me how to Execute macros from SAP.
    Regards,
    AJ

    To execute an Excel macro follow these steps.
    1. Create macro inside Excel Workbook where you transferred your information.
    2. Use following instruction to execute the desired macro you create:
        DATA: EXCEL TYPE OLE2_OBJECT.
        CREATE OBJECT EXCEL 'Excel.Application'.
        CALL METHOD OF EXCEL 'Run' EXPORTING #1 = 'WRITE_SHEET_CELL'
                                                                            #2 = 'VALUE1'
                                                                            #3 = 'VALUE2'
                                                                            #4 = 'VALUE3'.
    In previous example, macro WRITE_SHEET_CELL was created first. The macro name must be in uppercase.
    Regards.
    Rafael Rojas.

  • Execute Infopackage Through BAPI Using Excel Macro (BAPI_IPAK_START)

    Hi everyone,
    I have a problem when execute infopackage through BAPI using excel macro. I have create a button in macro. When this button is clicked, BAPI for trigger InfoPackage will executed (BAPI_IPAK_START) and this button will disabled.
    After this process completely done (traffic indicator for the request is green in update rules), the button will enabled again.
    Here the subroutine or pseudocode that i will write :
    Private Sub ClickButton()
    Begin
    1. ThisButton.Activated = False   --> Disabled Button
    2. Call BAPI/custom Function Module to execute InfoPackage (BAPI_IPAK_START)
    4. ThisButton.Activated = True   --> Enabled Button
    End
    The problem is i need some statement like this between statement no 2 and statement no 4
    Statement That I Want :
    3. Wait Until BAPI Execute Completely
    So user can click this button again only after the process is finished completely. I don't know how to do this in macro (in ABAP i know i can use "WAIT ... SECOND"), others said this can be done using event in schedule option at infopackage. Anyone,please help me.
    Thank you.
    Regards,
    Satria B

    Enter that req number in RSRQ and monitor the load
    or  right click on the DS - manage - you will req in yellow status which is in progress and you can click on the ...takes you monitor screen
    Edited by: Srinivas on Jul 6, 2010 7:51 AM

  • SSIS Script task not executing macro through SQL Agent (but it does through bids)

    <p>Hello everyone,</p><p>I am having an issue with SQL Agent when executing a macro contained in a script task component. The script task actually opens an excel file, runs the macro, save and closes the file. </p><p>When
    I execute the package via BIDS/Visual studio, it works like a charm. However, when i execute the package with SQL agent, the package runs successfully but it seems that the macro is not executed as the excel file has not been modified as it should have. Also,
    the history log does not show any error messages. </p><p>Could </p>

    Thanks!I did create a credential and a proxy too but still the macro is not executed.I have searched online for solutions but no one has experimented this kind of issue before it seems. Please have a look at the script task code:
    Imports
    Excel = Microsoft.Office.Interop.Excel
    Imports
    System
    Imports
    System.Data
    Imports
    System.Math
    Imports
    Microsoft.SqlServer.Dts.Runtime
    <System.AddIn.AddIn(
    "ScriptMain", Version:="1.0",
    Publisher:="", Description:="")>
    <System.CLSCompliantAttribute(
    False)> _
    Partial
    Public
    Class ScriptMain
    Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
    Enum ScriptResults
    Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
    Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    End
    Enum
    Public
    Sub Main()
    Dim Macro_name
    As
    String
    Dim ExcelObject
    As
    New Microsoft.Office.Interop.Excel.Application
    Dim oBook
    As Microsoft.Office.Interop.Excel.Workbook
    Dim oBooks
    As Microsoft.Office.Interop.Excel.Workbooks
    Try
    Macro_name =
    "Macro001"
    ExcelObject =
    CType(CreateObject("Excel.Application"),
    Excel.Application)
    ExcelObject.Visible =
    True
    ExcelObject.UserControl =
    False
    ExcelObject.DisplayAlerts =
    False
    oBooks = ExcelObject.Workbooks
    oBook =
    CType(oBooks.Open("C\Book1.xls"),
    Excel.WorkbookClass)
    ExcelObject.Run(Macro_name)
    Catch ex
    As Exception
    ExcelObject.Application.Quit()
    ExcelObject.DisplayAlerts =
    True
    ExcelObject =
    Nothing
    End
    Try
    Dts.TaskResult = ScriptResults.Success
    End
    Sub
    End
    Class

  • Execute an Excel Macro?

    Hello all,
    I created a report in which I show the result in an Excel...so far no problem... I open an Excel Template document, I pass the information I want to the places I want etc. The only problem is that I method for executing a macro seems not to work!
    Does somebody has an idea whats wrong?
    The security for macros in the excel is at medium...I already tried to put the security level to low...but nothing.
    The <i>retcode</i> has as result "MACRO_OR_SCRIPT_FAILED"
    I created the Macro and I am sure it works...because when I execute it manualy it does what it should do. Even after my report has open the documente and shows the document I can execute de macro and it works.
            call method p_g_document->execute_macro
              exporting
                macro_string = 'COPYSHEET'
              importing
                error        = it_errors
                retcode      = retcode.
    Just for information, the only thing the macro does is copying a spreadsheet.
    I somebody could help it would be great, I already lost some days to find the solution.
    Thanks in advanced.
    Marcelo Moreira

    Hey all,
    Does not seemes that someone has the answer I need, but my last question for this topic is....
    Does someone of you already implement a report, using an excel with macro calling from ABAP?
    I have doubts if the method
    <i>call method I_OI_DOCUMENT_PROXY->execute_macro</i> really work for Excel.
    Even in the SAPOFFICEINTEGRATION example I am not sure if it works.
    Maybe someone of you has an working example of macro calling from ABAP for Excel.
    I would be very glad if somebody has some ideas for my problem....I getting mad with this... :-S
    Greetings,
    Marcelo Moreira

  • Executing Excel Session in Background

    All,
    In SAP BW 3.5 we created a recording (through transaction SHDB) of accessing transaction UPSPL (is a SAP transaction with an Excel session embedded in it, data in the excel is written to the SAP database). Then generated an ABAP report of the recording. When running the ABAP report  through se38 in the background, the excel mentioned above is not called/executed correctly i.e. the macros in the excel are not executed (probably because simulating running Excel macros in background is technically not possible?).
    When running the ABAP report in the foreground (setting 'call transaction'), the report perfectly executes the macro i.e. result is the same as accessing and saving the excel manually through UPSPL.
    Read somewhere that installing Excel on SAP (BW) server could be an idea? Because in the above the Excel desktop version is called?
    Would you know how to solve the above? Or experiences with it? Thanks.
    Regards, Meindert Postma
    PS also posted the above on the SAP BW/BPS forum, from a more BPS point of view.
    Running BPS planning folder in background - possible?

    Hi Meinder Postma
    I don't know exactly how this works but I think it is like this:
    The embedded excel functionality is obtained via SAPgui objects.
    The application communicate with excel via a program-to-program-to-program interface between a program in the SAP kernel on the application server, via a SAPgui object on the PC with SAPgui installed and to excel on the same PC.
    Like this:
    Server SAP kernel <=> PC SAPgui <=> PC excel
    In this setup I see no possible way that this can run in background, because in background you have no SAPgui communication at all.
    best regards
    Thomas

  • Could not connect to Oracle database from excel macro. Getting connection not open.

    Hi all, 
    I could not connect to oracle database using excel macro. After much R&D also, I cannot find right solution. Please help me where I am doing wrong.
    Sub Button2_Click()
    Dim Conn As New ADODB.Connection
    Dim RS As New ADODB.Recordset
    Dim Cmd As New ADODB.Command
    Dim sqlText As String
    Dim Row As Long
    Dim Findex As Long
    Dim Data As Worksheet
    Dim X As Long
    Dim UID As String
    Dim PWD As String
    Dim Server As String
    Dim strCon As String
    Application.Calculation = xlCalculationManual
    UID = "myUserid" 'Enter the User ID
    PWD = "myPassword" 'Enter the password
    Server = "myHostname or myServername" 
    Set Data = Sheets("Sheet2")  
    Data.Select
    Range("A:J").ClearContents 
    strCon1 = "Provider = Microsoft.ACE.OLEDB.12.0;DATA SOURCE=myHostName;Database=myDBname;uid=myUserid;pwd=myPassword;"
    Conn.Open (strCon1)
    Cmd.ActiveConnection = Conn
    Cmd.CommandType = adCmdText
    ' Put your query next
    sqlText = " select * from table "
    Cmd.CommandText = sqlText
    Set RS = Cmd.Execute
    For X = 0 To 17 
    Data.Cells(1, X + 1) = RS.Fields(X).Name
    Next
    Do While Not RS.EOF 'this loops through the data and puts it in the spreadsheet
    Row = Row + 1
    For Findex = 0 To RS.Fields.Count - 1
    Data.Cells(Row + 1, Findex + 1) = RS.Fields(Findex).Value
    Next Findex
    RS.MoveNext
    Loop
    Application.Calculation = xlCalculationAutomatic
    Application.Calculate
    End Sub
    sammy

    I have set oci.dll in to the path specified. Prior to this I musy say that, I have 64 bit excel 2010 & installed respective drivers from the link provided http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
    But
    still I am facing as:-" Provider cannot be found. It may not be properly installed."
    sammy

  • Running Excel macros from ABAP

    Hello everyone,
    I am trying to execute an Excel macro from an ABAP program.  We are currently on a 46C system.  While doing some research on help.sap.com I came across the method execute_macro in class i_oi_document_proxy.  I’ve never used methods in ABAP before and I’m not really sure what I’m doing.  Has anyone got this to work?  When I try to run the program it dumps with error OBJECTS_OBJREF_NOT_ASSIGNED.
    Thanks,
    Becky
    Here is the program:
    REPORT ztest_program.
    INCLUDE ole2incl.
    DATA gs_excel TYPE ole2_object .
    DATA gs_wbooks TYPE ole2_object .
    DATA gs_wbook TYPE ole2_object .
    DATA gs_application TYPE ole2_object .
    DATA: h_sheet TYPE ole2_object.
    DATA: document TYPE REF TO i_oi_document_proxy.
    *Name of the macro in Excel
    DATA: macro_string(50) TYPE c
                     VALUE 'FB03process.FromTheBeginning',
          no_flush TYPE c,
          param_count TYPE i VALUE 0,
          script_name TYPE c VALUE 'X',
          error TYPE REF TO i_oi_error
                OCCURS 0 WITH HEADER LINE,
          retcode TYPE soi_ret_string,
          error_string(50) TYPE c,
          retvalue(30) TYPE c.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
             text       = text-007
         EXCEPTIONS
              OTHERS     = 1.
    CREATE OBJECT gs_excel 'EXCEL.APPLICATION' .
    SET PROPERTY OF gs_excel 'Visible' = 1 .
    GET PROPERTY OF gs_excel 'Workbooks' = gs_wbooks .
    GET PROPERTY OF gs_wbooks 'Application' = gs_application .
    *--Opening the existing document
    CALL METHOD OF gs_wbooks 'Open' = gs_wbook
         EXPORTING #1 = 'D:\temp\FB03process.xls' .
    tell user what is going on
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
              PERCENTAGE = 0
             text       = text-009
         EXCEPTIONS
              OTHERS     = 1.
    GET PROPERTY OF gs_excel 'ACTIVESHEET' = h_sheet.
    CALL METHOD document->execute_macro
         EXPORTING macro_string  = macro_string
                   param_count   = param_count
                   script_name   = script_name
                   no_flush      = no_flush
         IMPORTING error         = error
                   retcode       = retcode
         CHANGING  error_string  = error_string
                   retvalue      = retvalue.
    disconnect from Excel
    FREE OBJECT gs_excel.
    PERFORM err_hdl.
    FORM err_hdl.
      IF sy-subrc <> 0.
        WRITE: / 'Fehler bei OLE-Automation:'(010), sy-subrc.
        STOP.
      ENDIF.
    ENDFORM.                    " ERR_HDL

    Hi,
    Please correct me if I am wrong but it seems that you have not fetched a handle to the document object before issuing the statement CALL METHOD document->execute_macro. Hence the error OBJECTS_OBJREF_NOT_ASSIGNED is being dislayed. If you want to use SAP Desktop Office Integration using ABAP Objects, take a look at this article at http://www.intelligenterp.com/feature/archive/ or http://www.sapinfo.net/public/en/index.php4/article/comvArticle-193333c63b4bd807d2/en/articleStatistic
    Hope this helps.
    Regards
    Message was edited by: Shehryar Khan

  • Getting error while submitting data to excel workbook through excel services in InfoPath 2010

    Hi,
    I have a requirement where in have to fetch the calculated values from the excel workbook through InfoPath 2010 form.
    When I am submitting cell value to excel workbook using SetCellA1 by executing following action:
    "Submit using data connection: dataconnection"
    I am unable to submit form. It is giving "there has been an error while processing the form" in the front end. I checked the event viewer and it displayed following exception:
    There was a form postback error. (User: xxxx, Form Name: yyyyyyyy, IP: , Request:
    http://asadadsas Request Form Template.xsn&SaveLocation=/somelocation, Form ID: urn:schemas-microsoft-com:office:infopath:formname:-myXSD-2010-09-20T15-02-34, Type: KeyNotFoundException, Exception Message: The given key was
    not present in the dictionary.)
    I was successfully able to submit the form using InfoPath client but it is giving error in the browser.
    Is there any way or configuration that I should do to resolve this issue.
    Any suggesttion would be of great help.
    Thanks,
    Sharepoint Consultant from NY, USA

    I have exactly the same problem. The form is supposed to be submitted to the SOAP Web service (http://servername/_vti_bin/ExcelService.asmx) using the SetCellA1 operation, works fine in InfoPath Filler, but when I try to submit it in the browser, I get this
    error:
    There was a form postback error. (User: WINGTIP\Administrator, Form Name: NewEventForms, IP: , Request: http://intranet.wingtip.com/et/_layouts/FormServer.aspx?XsnLocation=http://intranet.wingtip.com/et/NewEventForms/Forms/template.xsn&SaveLocation=http://intranet.wingtip.com/et/NewEventForms&Source=http://intranet.wingtip.com/et/NewEventForms/Forms/AllItems.aspx&DefaultItemOpen=1,
    Form ID: urn:schemas-microsoft-com:office:infopath:NewEventForms:-myXSD-2011-12-29T18-18-45, Type: KeyNotFoundException, Exception Message: The given key was not present in the dictionary.)
    followed by
    Unhandled exception when rendering form on postback System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.    
     at System.ThrowHelper.ThrowKeyNotFoundException()    
     at System.Collections.Generic.Dictionary`2.get_Item(TKey key)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DatabaseHelper.GetSchemaXml(String namespaceUri, Solution solution, String dataObjectName, SchemaNavigator& schema, XPathNavigator& originalSchema, XmlNamespaceManager& namespaceManager)
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.PartFragmentHelper.IsDataSetNode(Solution solution, XPathNavigator node)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.PartFragmentHelper.ApplyPartFragmentGather(DataAdapter adapter, XPathNavigator sourceDOM, DataObjects dataObjects, XPathNavigator targetDOM, PartFragment[] partFragments, Boolean[]& areDataSets)
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterWebServiceSubmit.Execute(Document document, Uri soapAction, Uri serviceUrl, XPathNavigator querySubDOM, XPathNavigator resultsSubDOM, XPathNavigator errorsSubDOM, Int64 timeout, DataAdapterCredentials
    credentials, Boolean useDcl, Boolean useProxy, Boolean useSelf)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterWebServiceSubmit.ExecuteInternal(XPathNavigator queryFields, XPathNavigator resultFields, XPathNavigator errors)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.RuleAction.EvaluateExpression(Document document, XPathNavigator currentTarget)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.RulesRuleSet.EvaluateExpression(Document document, XPathNavigator targetNavigator)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.ExecuteDefaultSubmitAction()    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonSubmit.Click(Document document, XPathNavigator container)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventClick.Play(Document document, BindingServices bindingServices, EventLogProcessor eventLogProcessor)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventLogProcessor.ExecuteLog(Int32 expectedEventLogID)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.<>c__DisplayClass13.<PlayEventLog>b__11()    
     at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)
    What might be wrong? Are there any InfoPath configurations that need to be done? And, do I need to save the connection to the Excel Service Service Application to a connection file?
    Thanks,
             Boris

  • Excel macro error after deploying in Weblogic

    Halo,
    I have written excel macros and it is working fine.
    but if the same file if i try to open from hyperlink after deploying in Weblogic server , I get the error
    "error occured initializing the VBA libraries.
    If Microsoft Visual Basic for Applications (VBA) was not installed, or was set to Install on first use,
    (advertised, or set to install on demand) you may receive this error message.
    Depending on the mode of installation used and the rights of the user to change current settings,
    it is possible to install VBA through Control Panel, Add/Remove Programs, Microsoft Office, Add or Remove
    features. If Visual Basic for Applications is not listed as an installable feature of Office, the administrator
    of your system may have disabled it so it is impossible for you to install it. If VBA is not installed,
    it is impossible to run VBA applications/projects on this computer. "
    1. Even though Excel VBA application is installed in my machine , why am i getting this error.??
    2. I would like to know is there any way to open the excel file even though if the excel software is not installed in client machine??
    Appreciate your help.
    Thanks.

    Hi,
    I do not see any reason for this to not work.
    Is there any difference between the preferences for RX and RXI. Please go to "edit" -> "Preferences" -> "Security(Enhanced)" and uncheck "Enable protected mode at startup".
    Are you able to open any pdf from command line with the same command:
    "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"  <<PDF_FILE>>
    Thanks,
    Amish.

  • 'Edit in Place' for XLSM-files (Excel Macro-Enabled)

    Hi,
    is it possible to activate 'Edit in Place' for xlsm-files (Excel Macro-Enabled Workbook file)?
    For xls(x)-files there is the link 'Edit This File', but not for files of type 'xlsm' allthough they could be dealt the same way with Excel.
    I know I can edit this files using the 'Add-in for MS Office' and via the 'Vibe Desktop', but it would be nice to deal them like other Excel-files.
    thx
    Martin

    Originally Posted by mschuhmann
    RTFM helps I admit:
    Novell Vibe 3.3 Administration Guide > Site Setup > Setting Up Site-Wide Customizations > Configuring File Associations for Edit in Place Applications
    Novell Doc: Novell Vibe 3.3 Administration Guide - Configuring File Associations for Edit in Place Applications
    Append ".xlsm" for the variable edit.in.place.file.applet.extensions, edit.in.place.file.webdav.extensions
    Hi Martin,
    Yeah, the Vibe docs can help on occasion
    Still, thanks for feeding it back to the forums as it can be quicker finding a hit in the forums than having to go through the docs!
    Cheers,
    Willem

  • To upload an Excel macro settings into an ABAP program.

    Kindly suggest me if there is any FM in SAP that can read the file with .bas ext containing the Excel macro settings.
    As the requirement is to read the macro settings into the SAP program and use these settings for the new Excel sheet that will be created through this program xyz.
    thanks in advance.

    Hi,
    Please check the FM  : RH_START_EXCEL_WITH_DATA
    In the exporting Parameter : macro_name you can give the .bas file name from which the macro is read.
    Also check my response in the Thread :
    [Downloaded data in Excel from SAP table data to have the macro and control? |Re: Downloaded data in Excel from SAP table data to have the macro and cont]
    Cheers,
    Remi

  • Call Excel Macros function from Java

    Hi All,
    can u guide me How to call excel macros from java.
    The thing is first I have to enable macros and then call the macors function.
    Is this possible to call from Java. If yes guide me.
    Thanks in Advance

    Seems like something you'd have to do through COM.
    http://sourceforge.net/projects/jacob-project/
    HOW you do that is something you'll really have to figure out yourself, its not a Java question.

  • Excel macro issue

    I have an employee that uses the add-in and works with macros a lot in Excel. Occassionally, we he opens an Excel macro, it causes the Essbase toolbar to stop working. The dropdown essbase menu works, but the toolbar does not. He has to go through our service desk to get this resolved. Anyone know what causes this to happen?

    I would imagine that this is an intermittent problem or does it relate to a specific macro in a specific Excel worksheet ? Problem should go away with a reboot, another question would be why you are suporting freeware ? It should always come with a warning that it is freeware and outwith any company support policy. In most organisations the behaviour of user created macros is something that an IT support function will not go anywhere near.

  • Translate Excel Macro to Abap

    Hi all,
    I have the following macro recorded in my excel and want to 'translate' it to abap.
    The problem is that though it does not give any error and not sy-subrc <> 0 don't works well.
    When I select the cells to which I have put a name,  this name does not appear, if I execute the macro from the excel yes it works well.
    This is the macro;
    ActiveWorkbook.Names.Add Name:="nums", RefersToR1C1:="=Hoja1!R3C1:R8C1"
    Though also it works this way;
    ActiveSheet.Names.Add Name:="nums", RefersToR1C1:="=Hoja1!R3C1:R8C1"
    And this de abap code;
    CREATE OBJECT application 'Excel.Application'.
    CALL METHOD  OF application  'Workbooks' = workbooks.
    CALL METHOD  OF workbooks     'Add' = workbook.
    SET PROPERTY OF application 'Visible' = 0.
    GET PROPERTY OF application 'ACTIVESHEET' = worksheet.
    SET PROPERTY OF worksheet 'Name' = 'Unidades'.
    *....fill cells...
    *Option 1;
    CALL METHOD OF application 'ActiveWorkbook' = o_workbook.
    CALL METHOD OF o_workbook 'names' = o_names.
    *Option 2;
    *CALL METHOD OF application 'ActiveSheet' = worksheet.
    *CALL METHOD OF worksheet 'names' = o_names.
    CALL METHOD OF o_names 'Add'
        EXPORTING
          #1 = 'nums'
          #2 = 'Unidades!R3C1:R8C1'.
    The problem is to instantiate the object o_name.  after "CALL METHOD OF o_workbook 'names' = o_names" if in debbuging I do double-click on the variable, it is empty.
    any idea?
    Thanks in advance.

    I did it !!!
      CALL METHOD OF application 'ActiveSheet' = worksheet.
      CALL METHOD OF worksheet 'Cells' = o_cellstart
        EXPORTING
        #1 = 3
        #2 = 1.
      CALL METHOD OF worksheet 'Cells' = o_cellend
        EXPORTING
        #1 = 184
        #2 = 1.
      CALL METHOD OF worksheet 'range' = range
        EXPORTING
        #1 = o_cellstart
        #2 = o_cellend.
      CALL METHOD OF range 'select'.
    SET PROPERTY OF range 'Name' = 'nums'.

Maybe you are looking for

  • Need help: trouble printing a doc into a pdf

    Hello I can not take a word docx or any other format and convert it into a pdf format.  When I click on printer, then pdf, hit ok - it gives me : invalid "adobe pdf" printer properties: do not change spooler settings. Please selete "print directly to

  • HT3187 What happened to my movies and music list on my apple tv

    I have lost my audio for video on itunes and also have lost movies and music and apps on my itunes for my appletv whats the deal ?

  • Problem in jnlp file

    hi, For sandbox i created the repository.jnlp file and used. at the same time i created the repository.jnlp file for developement server but it giving the error as "com.sap.aii.utilxi.misc.api.ReconnectRuntimeException" "Cannot open connection on hos

  • Convert number to character  - unicode conversion

    I have a variable defined as v (4) type n I need to put this into a char field of 4 as part of our unicode conversion. Is there a FM that can help ?

  • Error with sql developer converter....

    I am converting a view to pl/sql from ms SQL. I have a particular line of code that is causing an error. MS SQL: NULLIF(dbo.ItemVarValues.ItemVarValueName, '') IS NOT NULL PL/SQL: AND NULLIF(itemvarvalues.itemvarvaluename, ' ' ) IS NOT NULL; Getting