Invalid method "Save As" from Excel application object

I have Windows 2000 and Excel 2002 installed on my machine.
I down loaded "renamed Excel 2000 workbook.vi" from NI website. Relinked ref num to Excel application object but get the error of invalid method (Save As). Tried to relink invoke node to Save As by selecting method from drop down menu. However this method is not on the list. Tried other excel objects but can not find "Save As" method. Has this been removed/moved?

I was able to correct the error by relinking the Workbooks->Open to Open. This changes the subsequent Invoke Node from IAppEvents to _Workbook. There you will find the Save As method.
Michael
www.abcdefirm.com
Michael Munroe, ABCDEF
Certified LabVIEW Developer, MCP
Find and fix bad VI Properties with Property Inspector

Similar Messages

  • How to Use AccessibleObjectFromWindow API in VBA to Get Excel Application Object from Excel Instance Window Handle

    I need to get the Excel.application object from a window handle using AccessibleObjectFromWindow. I can't seem to make the code work. First, I successfully search for the XLMAIN windows. Then, when I get a handle, I execute the AccessibleObjectFromWindow
    function. It seems to return a value of -2147467262 in all cases. Therefore, I believe that it is returning an error value. I can't figure out how to determine the meaning of this value.
    If it is an error value, I believe that one or more arguments are in error. My best guess at present is that the GUID argument is incorrect. I have tried two GUID values: {00020400-0000-0000-C000-000000000046} and {90140000-0016-0409-0000-0000000FF1CE}.
    I have seen both used in conjunction with OBJID_NATIVEOM. Neither one seems to work. I really would prefer not to use the second one as it has an Excel major and minor version number. I would hate to have to change this code, if a new minor version appeared.
    The attached code has been commented to show which parts have been shown to work and which not. I'm at my wits end and really need help.
    Thanks
    'This module is located in Access 2010, but this is an Excel question.
    Option Compare Database
    Option Explicit
    ' Module-Level Declarations
    'The GetDesktopWindow function and FindWindowEx function work just fine.
    Public Declare Function GetDesktopWindow Lib "user32" () As Long
    Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Long, _
    ByVal hWnd2 As Long, _
    ByVal lpsz1 As String, _
    ByVal lpsz2 As String) _
    As Long
    'I'm not getting the expected output from this function (see below)
    Private Declare Function AccessibleObjectFromWindow& Lib "oleacc.dll" _
    (ByVal hwnd&, _
    ByVal dwId&, _
    riid As GUID, _
    xlwb As Object)
    Type GUID
    lData1 As Long
    iData2 As Integer
    iData3 As Integer
    aBData4(0 To 7) As Byte
    End Type
    Function ExcelInstances() As Long
    ' Procedure-Level Declarations
    ' Value of OBJID_NATIVEOM verified by checking list of Windows API constants _
    on this site: http://www.lw-tech.com/q1/base.htm
    Const OBJID_NATIVEOM = &HFFFFFFF0
    Dim hWndDesk As Long 'Desktop window
    Dim hWndXL As Long 'Child window
    Dim objExcelApp As Object 'Final result wanted: Excel application object
    'Following variable (xlapp) to be set by AccessibleObjectFromWindow function
    Dim xlapp As Object
    Dim IDispatch As GUID 'GUID used in call to AccessibleObjectFrom Window function
    'Set up GUID to be used for all instances of Excel that are found
    Dim tmp1 As Variant 'Return value from AccessibleObjectFromWindow
    ' Executable Statements
    SetIDispatch IDispatch
    IDispatch = IDispatch
    'Get a handle to the desktop
    hWndDesk = GetDesktopWindow 'This seems to work
    Do
    'Get the next Excel window
    'The following statement seems to work. We are finding and counting _
    correctly all the instances of Excel. hWndXL is non-zero for each _
    instance of Excel
    hWndXL = FindWindowEx(GetDesktopWindow, hWndXL, "XLMAIN", vbNullString)
    'If we got one, increment the count
    If hWndXL > 0 Then
    'This works. We correctly count all _
    instances of Excel
    ExcelInstances = ExcelInstances + 1
    'Here is the problem. The following statement executes and returns a value of _
    -2147467262. xlapp, which is passed by reference to AccessibleObjectFromWindow, _
    is set to nothing. It should be set to the object for Excel.application. _
    I believe that this value is not an object. I tried to reference tmp1. in the _
    immediate window. There was no Intellisense.
    'I think that the function in returning an error value, but I can't figure _
    out what it is. I believe that AccessibleObjectFromWindow returns error _
    values, but I don't know where to find their values so I can interpret the _
    function's results.
    'As best I can tell, the hWndXL parameter is correct. It is the handle for _
    an instance of Excel. OBJID_NATIVEOM is set correctly (see constant declaration _
    above). xlapp is passed by reference as a non-initialized object variable, which _
    will be set by AccessiblObjectFromWindow. IDispatch may be the problem. It is set _
    as shown below in the procedure SetIDispatch(ByRef ID As GUID). This procedure _
    appears to work. I can see that IDispatch is set as I intended and correctly _
    passed to AccessibleObjectFromWindow.
    tmp1 = AccessibleObjectFromWindow(hWndXL, OBJID_NATIVEOM, IDispatch, xlapp)
    'Need to write code to test tmp1 for error. If none, then set objExcelApp = _
    object. Also, I exect xlapp to be set to Excel.application
    End If
    'Loop until we've found them all
    Loop Until hWndXL = 0
    End Function
    Private Sub SetIDispatch(ByRef ID As GUID)
    'Defines the IDispatch variable. The interface _
    ID is {90140000-0016-0409-0000-0000000FF1CE}.
    'NOT USING {00020400-0000-0000-C000-000000000046}, _
    which could be the problem
    '9 is release version - first version shipped (initial release)
    '0 is release type - retail/oem
    '14 is major version
    '0000 is minor version
    '0016 is product ID - MS Excel 2010
    '0409 is language identifier - English
    '0 is x86 or x64 - this is x86
    '000 reserved
    '0 is debug/ship
    '000000FF1CE is office family ID
    With ID
    .lData1 = &H90140000
    .iData2 = &H16
    .iData3 = &H409
    .aBData4(0) = &H0
    .aBData4(1) = &H0
    .aBData4(2) = &H0
    .aBData4(3) = &H0
    .aBData4(4) = &H0
    .aBData4(5) = &HF
    .aBData4(6) = &HF1
    .aBData4(7) = &HCE
    End With
    End Sub
    DaveInCalabasas

    I don't think you can return a reference to Excel's main window like that as you are attempting to do.
    Ref:
    http://msdn.microsoft.com/en-us/library/windows/desktop/dd317978(v=vs.85).aspx 
    It's relatively straightforward to return any workbook's window in any given instance, and in turn it's parent Excel app. Try the following and adapt as required (and include error handling) -
    Option Explicit
    Private Declare Function FindWindowEx Lib "User32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
    ByVal lpsz2 As String) As Long
    Private Declare Function IIDFromString Lib "ole32" _
    (ByVal lpsz As Long, ByRef lpiid As GUID) As Long
    Private Declare Function AccessibleObjectFromWindow Lib "oleacc" _
    (ByVal hWnd As Long, ByVal dwId As Long, ByRef riid As GUID, _
    ByRef ppvObject As Object) As Long
    Private Type GUID
    Data1 As Long
    Data2 As Integer
    Data3 As Integer
    Data4(7) As Byte
    End Type
    Private Const S_OK As Long = &H0
    Private Const IID_IDispatch As String = "{00020400-0000-0000-C000-000000000046}"
    Private Const OBJID_NATIVEOM As Long = &HFFFFFFF0
    Sub test()
    Dim i As Long
    Dim hWinXL As Long
    Dim xlApp As Object ' Excel.Application
    Dim wb As Object ' Excel.Workbook
    hWinXL = FindWindowEx(0&, 0&, "XLMAIN", vbNullString)
    While hWinXL > 0
    i = i + 1
    Debug.Print "Instance_" & i; hWinXL
    If GetXLapp(hWinXL, xlApp) Then
    For Each wb In xlApp.Workbooks
    Debug.Print , wb.Name
    Next
    End If
    hWinXL = FindWindowEx(0, hWinXL, "XLMAIN", vbNullString)
    Wend
    End Sub
    'Function GetXLapp(hWinXL As Long, xlApp As Excel.Application) As Boolean
    Function GetXLapp(hWinXL As Long, xlApp As Object) As Boolean
    Dim hWinDesk As Long, hWin7 As Long
    Dim obj As Object
    Dim iid As GUID
    Call IIDFromString(StrPtr(IID_IDispatch), iid)
    hWinDesk = FindWindowEx(hWinXL, 0&, "XLDESK", vbNullString)
    hWin7 = FindWindowEx(hWinDesk, 0&, "EXCEL7", vbNullString)
    If AccessibleObjectFromWindow(hWin7, OBJID_NATIVEOM, iid, obj) = S_OK Then
    Set xlApp = obj.Application
    GetXLapp = True
    End If
    End Function
    Note as written if an instance does not have any loaded workbooks a reference will not be returned (though a workbook can be added using DDE, but convoluted!)
    FWIW there are two other very different approaches to grab all running Excel instances though something along the lines of the above is simplest.
    Peter Thornton

  • Error  when instantiating a Com( EXCEL.APPLICATION) object in WINDOWS XP

    Hi,
    I am using coldfusion MX7 and OS is WindowXP. I am using COM
    object with Excel.Application for my program. but it is giving the
    below error. But same program is working in Window Profesional.
    ERROR IS:
    An exception occurred when instantiating a Com object.
    The cause of this exception was that: AutomationException:
    0x80080005 - Server execution failed. Note that Windows 95 does not
    support automatic launch of a server, it must be running already.
    The error occurred in
    C:\CFusionMX7\wwwroot\XXX\report_top20.cfm: line 15
    13 : t1=now();
    14 : path=GetDirectoryFromPath(ExpandPath("*.*"));
    15 : xl=CreateObject("COM", "Excel.Application");
    16 : wbks=xl.workbooks;
    17 : tmp=wbks.open(path & "top20_template.xls");
    Plz help me.
    Reagrds,
    DRA.

    Hi,
    If possible, would you please share your Excel file with us, you can upload it to a file sharing site(Like OneDrive), and then share the link with us. Also please take a look of this article:
    http://support.microsoft.com/kb/178510
    For the warning message, It means that in Excel 2010 and Excel 2007, you can use special effects, such as transparent shadows that are not supported in Excel 97-2003. The special effects will be removed. In the Compatibility Checker, click
    Find to locate the objects that have special effects applied so that you can remove those effects as needed.
    Wind Zhang
    TechNet Community Support

  • Giving a specific path to the reading from excel application

    Hello, i want to know there is a way of giving a specific path to an application (reading from excel sheet) without all the time getting to enter the path? if someone could help. i'm using labview 8.0
    Regards,
    Tchaou

    you could just use a path constant. Drop a path constant on the BD and right click on it and select browse and then find the file you want.
    Joe.
    "NOTHING IS EVER EASY"

  • Save Image from excel

    Hi,
    I want to export images from an excel sheet. Cell A1 would be the input of the folder name where the images would be saved.Column C will contain images. Once a user click on a button all the images that are in column C will be exported to the folder name
    mentioned in cell A1. The image name would be decided based on their appearance in excel sheet. E.G. 1st image in C column would have file name as Image 1,2nd image Image 2 and so on... until last image found in C column.  I have one piece of code but
    I am getting Out of memory error.Any help would be appreciated.
    Const saveSceenshotTo As String = "C:\Users\Deb\Desktop\" ' change path to where you want to save
    Const pictureFormat As String = ".jpg" ' change file extension
    Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function GetClipboardData Lib "user32" (ByVal wFormat As Integer) As Long
    Private Declare Function CloseClipboard Lib "user32" () As Long
    Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (PicDesc As uPicDesc, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long
    Private Type GUID
    Data1 As Long
    Data2 As Integer
    Data3 As Integer
    Data4(0 To 7) As Byte
    End Type
    Private Type uPicDesc
    Size As Long
    Type As Long
    hPic As Long
    hPal As Long
    End Type
    Private Const CF_BITMAP = 2
    Private Const PICTYPE_BITMAP = 1
    ' run this sub to export pictures
    Private Sub CommandButton1_Click()
    Dim i As Long
    i = 1
    Dim pic As Shape
    For Each pic In ActiveSheet.Shapes
    pic.Copy
    MyPrintScreen (saveSceenshotTo & Range("A" & i).Text & pictureFormat)
    i = i + 1
    Next
    End Sub
    Public Sub MyPrintScreen(FilePathName As String)
    Dim IID_IDispatch As GUID
    Dim uPicInfo As uPicDesc
    Dim IPic As IPicture
    Dim hPtr As Long
    OpenClipboard 0
    hPtr = GetClipboardData(CF_BITMAP)
    CloseClipboard
    With IID_IDispatch
    .Data1 = &H7BF80980
    .Data2 = &HBF32
    .Data3 = &H101A
    .Data4(0) = &H8B
    .Data4(1) = &HBB
    .Data4(2) = &H0
    .Data4(3) = &HAA
    .Data4(4) = &H0
    .Data4(5) = &H30
    .Data4(6) = &HC
    .Data4(7) = &HAB
    End With
    With uPicInfo
    .Size = Len(uPicInfo)
    .Type = PICTYPE_BITMAP
    .hPic = hPtr
    .hPal = 0
    End With
    OleCreatePictureIndirect uPicInfo, IID_IDispatch, True, IPic
    SavePicture IPic, FilePathName
    End Sub
    Thanks!!
     

    The following macro will do the following...
    1) Check to make sure that the path in E1 is a valid one.
    2) Check whether the folder in A1 already exists within the directory specified in E1.
    3) If a folder does not already exist, one is created, and the images are exported into the newly created folder.
    4) If a folder already exists, the user is advised, and the procedure ends.
    Option Explicit
    Sub ExportPictures()
    Dim oShape As Shape
    Dim oChrtObj As ChartObject
    Dim sPath As String
    Dim sFolder As String
    Dim sPathAndFolder As String
    Dim sErrMsg As String
    Dim PicCnt As Long
    If TypeName(ActiveSheet) <> "Worksheet" Then Exit Sub
    On Error GoTo ErrHandler
    Application.ScreenUpdating = False
    sPath = Range("E1").Value
    sFolder = Range("A1").Value
    If Len(Dir(sPath, vbDirectory)) > 0 Then
    If Right(sPath, 1) <> "\" Then sPath = sPath & "\"
    Else
    sErrMsg = "The specified path is invalid."
    GoTo ErrHandler
    End If
    sPathAndFolder = sPath & sFolder
    If Len(Dir(sPathAndFolder, vbDirectory)) = 0 Then
    MkDir sPathAndFolder
    Else
    sErrMsg = "A folder called '" & sFolder & "' already exists."
    GoTo ErrHandler
    End If
    PicCnt = 0
    With ActiveSheet.ChartObjects.Add(0, 0, 250, 250)
    .Border.LineStyle = 0
    For Each oShape In ActiveSheet.Shapes
    If oShape.Type = msoPicture Then
    If Not Intersect(oShape.TopLeftCell, Columns("C")) Is Nothing Then
    PicCnt = PicCnt + 1
    oShape.Copy
    With .Chart
    With .ChartArea
    .Width = oShape.Width + 2
    .Height = oShape.Height + 2
    End With
    .Paste
    .Export Filename:=sPathAndFolder & "\" & "Image " & PicCnt & ".jpg", FilterName:="jpg"
    .Pictures(1).Delete
    End With
    End If
    End If
    Next oShape
    .Delete
    End With
    MsgBox "Images exported: " & PicCnt, vbInformation
    ExitTheSub:
    Application.ScreenUpdating = True
    Set oShape = Nothing
    Set oChrtObj = Nothing
    Exit Sub
    ErrHandler:
    If Len(sErrMsg) > 0 Then
    MsgBox sErrMsg, vbInformation, "Unable to Continue"
    GoTo ExitTheSub
    Else
    If Err <> 0 Then
    MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, "Error"
    Resume ExitTheSub
    End If
    End If
    End Sub
    Hope this helps!
    Domenic Tamburino Microsoft MVP - Excel xl-central.com - "For Your Microsoft Excel Solutions"

  • SharePoint Library - If I save file from Excel File Save As - then I always get "File already exists. Do you want to replace it?" - Upload works fine though.

    Hi there,
    In my SP 2010 document library - When I try to save an Excel file from File > Save As menu to the document library it always prompts me "File already exists. Do you want to replace it?" even though the file does not exist in that document library.
    To the same document library - if I upload a file then it accepts it all fine.
    Any clues why I cannot save files using File > Save As menu?
    Thanks.

    Hi,
    As I understand, the notification pops up when you save an excel file to SharePoint library, while when directly upload file to library, there is no wrong.
    Please confirm if the issue occurs to other machines.
    Please open Microsoft Office Upload Center on the issue machine, then click settings, clear cache via checking Delete files from the Office Document Cache when they are closed.
    http://office.microsoft.com/en-in/excel-help/office-document-cache-settings-HA010388664.aspx
    If the issue occurs to client, I’d recommend you also ask the question in Excel forum:
    http://social.technet.microsoft.com/Forums/office/en-US/home?forum=excel
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Extracting URL From Application Object

    If I type http://mymachine.com/myapp?a=aaa&b=bbb in my browser (to access application "myapp") how do I extract just the http://mymachine.com/myapp part from the application object? I would have figured that the code below would allow me to construct that string but these methods instead return the stuff in comments...
    URL theURL = application.getResource("/");
    theURL.getProtocol(); // jndi
    theURL.getHost(); // null
    theURL.getPort(); // -1
    theURL.getFile(); // org.apache.naming.resources.FileDirContext@!8bf135
    URL theURL = application.getResource("/myapp");
    theURL.getProtocol(); // null pointer exception
    theURL.getHost(); // null pointer exception
    theURL.getPort(); // null pointer exception
    theURL.getFile(); // null pointer exception

    tech note... HttpUtils is depricated for newer Servlet APIs (2.3+). Instead, you would use the same methods in the HttpServletRequest:
    URL theURL = new URL(request.getRequestURL().toString());

  • How to call  Java method from SAPUI5 applications?

    Hi Experts,
        Please give me information that how can I call Java method or jars from SAPUI5 applications?
    Thanks,
    Nag

    Hello Nag,
    why do open this thread in BRM Space? I would suggest reopen this in "UI Development Toolkit for HTML5 Developer Center" Space.
    Regards,
    Tobias

  • Application Object - ApplicationData

    Hello All:
    I am trying to set retreive an Application-wide variable from the Application object from within a P.E.I. using the ApplicationData object.
    I see the GetApplication() that returns a com.plumtree.uiinfrastructure.web.IApplication object but the methods there dont seem to be what I am looking for.
    Anyone run into something similar?
    Thanks.

    The GetCachingManager method on IApplication gives you a CachingManager class on which you can set and get data.

  • Exporting / Copying settings from ACR Smart Object

    How do I export the RAW processing settings from an ACR Smart Object in Photoshop?
    If I use Save Settings it only allows exporting a subset of the settings (no spot removal and local adjustments).
    If I use Export Settings to XMP it doesn't seem to do anything.
    The only way I've found to do it is to Save Image (from the Smart Object in ACR), save as a DNG, then use ExifTool to extract the XMP. Surely there must be an easier way?

    I ABSOLUTELY agree......  That's exactly, I believe, how it's SUPPOSED to work.
    Except that mine didn't.
    I opened a 12.2 MP RAW file. 
    And made absolutely no changes to the workflow uptions at the time of opening.
    But instead of "Image Sizing" saying "Default 12.2 MP", it said "3.6MP"
    Resize was turned OFF
    Width was 2321 px and height was 1824 px, BOTH GRAYED OUT.
    Upon leaving ACR, I had a 2321x1824 file.
    Eventually, after wasting another hour screwing around with it, I finally blew away all of Bridge AND the preferences and all that,
    and rebooted since the %$#)(*& Adobe CC thing wouldn't figure out there was no more Bridge, and resintalled...........
    Now, when I open a file in there, at LEAST it knows it's 12.2MP.
    It STILL wants to change the Space to sRGB, which I NEVER use from here, and the Depth to 8-bit, which again, I never use in ACR,
    but I can set those back to what they should be...
    So, in this case, by using a large enough bludgeon, I appear to have gotten around the problem.  Now I'm just waiting to see how soon it screws up again.

  • When i paste some copied color text or formatted cells from excel to my mail draft while composing a mail, it is being pasted as plain text. No back groud or text colors are copied to it. Please suggest a possible solution for this issue.

    Colors & Formatted Cells from Excel application can not be copied to my mail composer as it is. Only Plain text is copied.

    Wish I could be king. But you described the problem perfectly and I am still but a pawn. All I can say is that I trashed the mail preferences (com.apple.mail.plist) on my Mac Mini, and now my MacBook seems to work right.
    Sorry. :>) But that is the truth... The MacBook now has actually sometimes displayed pasted text in its actual, different, font and style as I paste it into a partially composed new mail message.
    In other (more rational) words, the problem seems to be tied to pasting only certain types of text. I have not been able yet to pinpoint what. Yes, frustrating indeed. The only work-around has been to re-train my fingers to command-option-shift V, for "paste and match style" (like you, I do not want to always use only plain text). Maybe someone else will eventually weigh in with a real solution. The solution I want is just to be able to consistently see any font variations within my message before I send the email.
    The info about the different ppi scales between Windows and Mac is interesting, although not relevant to this particular problem. It does explain the apparent overall size differences I have seen before.

  • Get image from Excel as shape and Save as .jpg

    Hello,
       I'm fairly new to ActiveX and am having a hard time doing a seemingly simple thing: getting a named image from an Excel file and saving it as a .jpg.  I have seen similar things done for Excel chart objects, but as I understand it images are "shapes" in Excel and I've been unable to find the right method to extract a shape. Please, if anyone could take a look at the attached folder and tell me if I am on the right track, if there is a better way to do this, or if there is a way to do this at all, it would be helpful.  Note that I don't care how efficient a strategy is developed - if I need to save to an intermediate file of another type, that's fine. The only goal is to be able to extract this image and save it with one mouse-click and no manual intervention.
    Folder contains: 1 example Excel file containing the image named "Picture 1"; 1 vi showing the method I've found for exporting Excel charts as .jpg's; and 1 vi with the progress I have made so far trying to pick the image from the Excel file and save it as a .jpg.  
    Thanks in advance!
    Megan
    Solved!
    Go to Solution.
    Attachments:
    GetExcelPicture.zip ‏70 KB

    Hi megan,
    see this link.
    Hope it helps.
    Mike

  • Ole excel application from abap

    Hi all ,
               I   an calling  one excel application  from abap .  I   don't want to make excel file visible ,  but insted  want to save and close the file , by using method
    saveas for excel application  and later i want to see the file . file name i want to store in a variable .
    eg :
    CALL METHOD OF H_EXCEL 'FILESAVEAS' = RC
    EXPORTING #1 =  filename .
    Can it be possible ?
    regards,
    SA

    hi
    i simpler method will be to use the function modules for this purpose.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
             PROGRAM_NAME        = SYST-CPROG
             DYNPRO_NUMBER       = SYST-DYNNR
             FIELD_NAME          = ' '
             IMPORTING
               file_name           = file_name .
              lc_filename = file_name.
              CALL FUNCTION 'GUI_DOWNLOAD'
                EXPORTING
                BIN_FILESIZE                    =
                  filename                        = lc_filename
                  filetype                        = 'DAT'
                TABLES
                  data_tab                        = gt_itab.
              IF sy-subrc <> 0.
              MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
    Fn module F4_filename will prompt for the name of the file to be saved  and GUI_DOWNLOAD will save the file.
    gt_itab is the internal table containing the data to be stored in excel.

  • CREATE OBJECT h_excel 'EXCEL.APPLICATION'.

    hi all!
    I need know, what method or property i have to use, for set up the filename by default, for the workbook that i created.
    thank in advance

    You assign the file name when you save the file.
    For example......
    data: e_sheet type ole2_object.
    data: e_appl  type ole2_object.
    data: e_work  type ole2_object.
    data: e_cell  type ole2_object.
    data: e_wbooklist type ole2_object.
    parameters: p_file type localfile default 'C:Test.xls'.
    start-of-selection.
    * Start the application
      create object e_appl 'EXCEL.APPLICATION'.
      set property of e_appl 'VISIBLE' = 0.
    * Open the file
      call method of e_appl 'WORKBOOKS' = e_wbooklist.
      get property of e_wbooklist 'Application' = e_appl .
      set property of e_appl 'SheetsInNewWorkbook' = 1 .
      call method of e_wbooklist 'Add' = e_work .
      get property of e_appl 'ActiveSheet' = e_sheet .
      set property of e_sheet 'Name' = 'Test' .
    * Position to specific cell  in  Column 1
        call method of e_appl 'Cells' = e_cell
               exporting
                    #1 = 1
                    #2 = 1.
    * Set the value
        set property of e_cell 'Value' = 'ABC'.
    ** Close the file
      get property of e_appl 'ActiveWorkbook' = e_work.
      call method of e_work 'SAVEAS'
            exporting
                #1 = p_file
                #2 = 1  .        " Don't ask me when closing
      call method of e_work 'close'.
    Regards,
    Rich Heilman

  • Calling a method from a UICommand Object

    How do I call an action method from a UICommand object?
    I create a HtmlCommandLink in my backing bean, and I think I should be setting the action, but with what? The method takes a MethodBinding but I can't find much detail on how to get that. I just want to call a method like linkAction1_action() in the example below, but you cannot pass a method.
    public class Page1 extends AbstractPageBean {
      private HtmlPanelGroup panel = new HtmlPanelGroup();
      public HtmlPanelGroup getPanel() {
        return panel;
      public void setPanel(HtmlPanelGroup panel) {
        this.panel = panel;
      public Page1() {
        HtmlCommandLink link = new HtmlCommandLink();
        link.setAction(/* what do I put here */);
        this.panel.getChildren().add(link);
      public String linkAction1_action() {
        return "GoBack";
    }

    OK. A couple days later and I am able to answer my
    own question. Anyway, I will lay it out there for
    anyone interested. This worked for me...
    public class Page1 extends AbstractPageBean {
    private HtmlPanelGroup panel = new HtmlPanelGroup();
    public HtmlPanelGroup getPanel() {
    return panel;
    public void setPanel(HtmlPanelGroup panel) {
    this.panel = panel;
    public Page1() {
    HtmlCommandLink link = new HtmlCommandLink();
    link.setAction(
    FacesContext.getCurrentInstance()
    .getApplication()
    .createMethodBinding("#{Page1.linkAction1_action}",
    new Class[0]));
    this.panel.getChildren().add(link);
    public String linkAction1_action() {
    return "GoBack";
    Since you're setting the action from within the Page1 object, why don't you create a method binding manually? This will be much more performant that using the application to create and EL-based binding.
    Try:
    link.setAction(new MethodBinding()
          public Object invoke(FacesContext facesContext, Object[] objects) throws EvaluationException, MethodNotFoundException
            return linkAction1_action();
          public Class getType(FacesContext facesContext) throws MethodNotFoundException
            return String.class;
    });Note that you also avoid any naming convention - you do not require your Page1 object to be configured as a managed bean "Page1".

Maybe you are looking for

  • How To create a rebate in SAP relating to a product group (3 digit). ??

    How To create a rebate in SAP relating to a product group (3 digit). ??

  • Calling a procedure in the loop

    Just want to know one thing : I am calling a procedure with the following parameters DECLARE     PROFIT_CENTER NUMBER; BEGIN   PROFIT_CENTER:= 1109 --( Similarly I am running the proc for 5 more profit_centers 1123,1132,1122,3211,1111 one by one by p

  • Flight Recorder does not provide Method Profiling Samples on CentOS 5

    Flight recorder from jdk 1.8.0_05 does not collect information about methods then running under CentOS 5. But jdk1.7.0_55 provides "Method Profiling Samples" events on the same machine. Steps to reproduce: 1. Download test class - https://gist.github

  • Booking time for different activities without involving costs

    Hi Friends, one of my requirement is,i need to define defferent activity types like Lunch time and driving time to capture the time for the different operations and infact it should not involve any cost related stuff,how can we acheive this in standa

  • GB3 MIDI backing track imports

    Has anyone imported multi-instrument MIDI backing track files into GB3? In my experience I find that the tracks when downloaded to my desktop play in QT player as a GMAT file perfectly. However, when imported into GB3 the track plays back substantial