How can I display Excel using Word VSTO Addin.

Hi all.
I am a beginner.
And studying Word VSTO ribbon addins.
I wrote very simple one (works charm );   
Microsoft.Office.Interop.Word.Application  oAPP  =  Globals.ThisAddIn.Application;
oAPP.Selection.InsertAfter( " Hello, Word !! " );        
oAPP.Selection.Collapse();
Now, I have to go on.
I want to display "Hello, Excel !! " from the same addin (from the Word Addin)
I tried to port the following VBA codes (into Word Addin);
    Set oEXCEL = CreateObject("Excel.Application")
    Set oWBOOK = oEXCEL.Workbooks.Add
    oWBOOK.ActiveSheet.Range("A1").Value = " Hello, Excel !! "
    oEXCEL.Visible = True
I do not know how to start from the very beginning.
I can not make "Application (for excel)" object at all.
VS says, the "Application" is not for the Excel but for the Word.
Yes, everybody know it. But, Excel has the same one too. So I tried to make casting. It never works.
I added required reference(s).
Wht do I have to do ?
Is it impossible, naturally ?
Regards

Hello,
The
How to automate Microsoft Excel from Microsoft Visual C#.NET  article describes all the required steps for automating Excel from any other application.
Anyway, the current forum is for VSTO specific questions. I'd suggest asking Excel or Word specific questions on the
Excel for Developers or
Word for Developers forums instead.

Similar Messages

  • How can I display Excel document saved as html in ebDynpro Office Contol?

    Hello,
    I have a problem with displaying of Excel document saved as html inside WebDynpro Office Control.
    Could you explain why OfficeControl cannot display Excel document with content type =text/htm?
    How you know, control must be bound to binary data. And then mime type is set as
    bin.setMimeType(new WebResourceType("html", "text/html", false));
    The empty document is displayed always.
    Nevertheless, excel file is displayed perfect, when
    bin.setMimeType(new WebResourceType("xls ", "application/msexcel", false));

    The OfficeControl UI element is made available as an ActiveX control, so that the UI element can be displayed in browsers that support ActiveX controls.
    The ActiveX control enables display of the following documents:
    1.Microsoft Word documents with the doc file extension
    2.Microsoft Excel documents with the xls file extension
    This is the reason why document with other content types are not displayed.
    Data source must be bound to binary data because files are read as bytes in this scenario.
    Hope this helps you.
    Do let me know if your problem is solved.
    Regards,
    Vijith

  • How can I display and use the full RAW file?

    Hi,
    my camera (Canon S95) has a sensor with 4:3 aspect ratio and thus saves all RAW files in this format. Additionally, the camera can automatically create JPGs with a cropped ratio (e.g. 3:2 or 16:9). This is very helpful because you can see the target format already on the camera screen (with black bars on top and bottom), which helps the composition. However, when processing the photos on the big screen afterwards, it often also helps the photo to adjust the ratio a little bit and therefore use the additional information saved in the bigger 4:3 RAW file. This works very well with many of the freely available software tools.
    The problem found in Lightroom is now that it only shows the RAW photo in the cropped format and up to know I have found no way to display or use the full RAW format. So my question is: Which settings do I have to change to use the full format? What do I need to change?
    Searching a little bit on the web I found many other photographes having the exactly same problem with many different cameras. However none of them reported to have a solution for this. Still I am pretty sure that there must be a solution, since otherwise this would be a really heavy bug within Lightroom and I cannot imagine that Adobe would leave this matter unsolved.
    So I would really appreciate if someone could help me with this.
    Many Thanks
    Martin

    Hi Jao, Victoria, Lee Jay,
    Thanks for clearification. Do you have additional information about when this fix will be available and whether at least some popular old cameras will be supported?
    What I do not get is why Adobe would need to redo all existing cameras. I think this is a more general issue, where Lightroom misinterpretes the exif data which includes both the exif image height/width as well as the cropped image height/width. Intepreting this information correctly, any software should be able to display both - the full image and the cropped area (as shown by many cheap or free software tools). In the internet I found another workaround for the issue in Lightroom, which is undermining this point: When setting the cropped image height/width to the numbers of exif image height/width manually (e.g. with exif tools), Lightroom actually is able to display the full 4:3 picture.
    So this bug should be easily fixed for all cameras and I have no clue why Adobe still has no fixed it with Lightroom already available in version 4.2.
    Cheers
    Martin

  • How can I download excel and word

    I need work in excel and word in my iPed - please guide

    You cannot download or install Word or Excel for the iPad. MS has not released an iOS version.
    There are MS Office compatible apps available in the app store like Quick Office Pro and Documents to Go. Take a look at those and see what you think. Apple also has their iWorks suite of apps, Pages, Numbers and Keynote that are compatible with the MS Office apps.

  • Help, I Can't open excel or word attachment​s

    I received an email with an excel attachment.  I open it and the screen is blank.  when I open a word attachment, it looks like a fuzzy picture of the doc.  How can I open and use word and excel attachments (I use office 2003)  

    This is not normal!! Can you please try with a soft reset of your device...pull the battary out for 30sec.
    tanzim                                                                                  
    If your query is resolved then please click on “Accept as Solution”
    Click on the LIKE on the bottom right if the post deserves credit

  • How can we make the ms-word data as read-only using java code?

    How can we make the ms-word data as read-only using java code?

    MVSK wrote:
    By using java code i opened a file in ms-word. But the data i want to display as read-only. that means should not change it.I don't think you can do that. Display pdf documents instead.

  • How can I display JTextFields correctly on a JPanel using GridBagLayout?

    I had some inputfields on a JPanel using the boxLayout. All was ok. Then I decided to change the panellayout to GridBagLayout. The JLabel fields are displayed correctly but the JTextField aren't. They are at the JPanel but have a size of 0??? So we cannot see what we type in these fields... Even when I put some text in the field before putting it on the panel.
    How can I display JTextFields correctly on a JPanel using GridBagLayout?
    here is a shortcut of my code:
    private Dimension sFieldSize10 = new Dimension(80, 20);
    // Create and instantiate Selection Fields
    private JLabel lSearchAbrText = new JLabel();
    private JTextField searchAbrText = new JTextField();
    // Set properties for SelectionFields
    lSearchAbrNumber.setText("ABR Number (0-9999999):");
    searchAbrNumber.setText("");
    searchAbrNumber.createToolTip();
    searchAbrNumber.setToolTipText("enter the AbrNumber.");
    searchAbrNumber.setPreferredSize(sFieldSize10);
    searchAbrNumber.setMaximumSize(sFieldSize10);
    public void createViewSubsetPanel() {
    pSubset = new JPanel();
    // Set layout
    pSubset.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    // Add Fields
    gbc.gridy = 0;
    gbc.gridx = GridBagConstraints.RELATIVE;
    pSubset.add(lSearchAbrNumber, gbc);
    // also tried inserting this statement
    // searchAbrNumber.setText("0000000");
    // without success
    pSubset.add(searchAbrNumber,gbc);
    pSubset.add(lSearchAbrText, gbc);
    pSubset.add(searchAbrText, gbc);
    gbc.gridy = 1;
    pSubset.add(lSearchClassCode, gbc);
    pSubset.add(searchClassCode, gbc);
    pSubset.add(butSearch, gbc);
    }

    import java.awt.*;
    import java.awt.event.*;
    import javax .swing.*;
    public class GridBagDemo {
      public static void main(String[] args) {
        JLabel
          labelOne   = new JLabel("Label One"),
          labelTwo   = new JLabel("Label Two"),
          labelThree = new JLabel("Label Three"),
          labelFour  = new JLabel("Label Four");
        JLabel[] labels = {
          labelOne, labelTwo, labelThree, labelFour
        JTextField
          tfOne   = new JTextField(),
          tfTwo   = new JTextField(),
          tfThree = new JTextField(),
          tfFour  = new JTextField();
        JTextField[] fields = {
          tfOne, tfTwo, tfThree, tfFour
        Dimension
          labelSize = new Dimension(125,20),
          fieldSize = new Dimension(150,20);
        for(int i = 0; i < labels.length; i++) {
          labels.setPreferredSize(labelSize);
    labels[i].setHorizontalAlignment(JLabel.RIGHT);
    fields[i].setPreferredSize(fieldSize);
    GridBagLayout gridbag = new GridBagLayout();
    JPanel panel = new JPanel(gridbag);
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    gbc.insets = new Insets(5,5,5,5);
    panel.add(labelOne, gbc);
    panel.add(tfOne, gbc);
    gbc.gridwidth = gbc.RELATIVE;
    panel.add(labelTwo, gbc);
    gbc.gridwidth = gbc.REMAINDER;
    panel.add(tfTwo, gbc);
    gbc.gridwidth = 1;
    panel.add(labelThree, gbc);
    panel.add(tfThree, gbc);
    gbc.gridwidth = gbc.RELATIVE;
    panel.add(labelFour, gbc);
    gbc.gridwidth = gbc.REMAINDER;
    panel.add(tfFour, gbc);
    final JButton
    smallerButton = new JButton("smaller"),
    biggerButton = new JButton("wider");
    final JFrame f = new JFrame();
    ActionListener l = new ActionListener() {
    final int DELTA_X = 25;
    int oldWidth, newWidth;
    public void actionPerformed(ActionEvent e) {
    JButton button = (JButton)e.getSource();
    oldWidth = f.getSize().width;
    if(button == smallerButton)
    newWidth = oldWidth - DELTA_X;
    if(button == biggerButton)
    newWidth = oldWidth + DELTA_X;
    f.setSize(new Dimension(newWidth, f.getSize().height));
    f.validate();
    smallerButton.addActionListener(l);
    biggerButton.addActionListener(l);
    JPanel southPanel = new JPanel(gridbag);
    gbc.gridwidth = gbc.RELATIVE;
    southPanel.add(smallerButton, gbc);
    gbc.gridwidth = gbc.REMAINDER;
    southPanel.add(biggerButton, gbc);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(panel);
    f.getContentPane().add(southPanel, "South");
    f.pack();
    f.setLocation(200,200);
    f.setVisible(true);

  • How can i display the values in the vector in a jsp using jstl

    in a task i am recieving a vector in a jsp... how can i display those vector values in the jsp using jstl.... plz help me
    thanks in advance

    <%
    here you got vector say; v
    pagecontext.setAttribute("varname",v);
    %>
    <c:forEach var="i" items="${varname}">
    <c:out value="${i}">
    </c:forEach>

  • How can I display special characters of NonEuropean languages (French, Italian, Spanish, German and Portuguese.) using import string mechanism

    I would like to translate the User Interface of my application to French, Italian, Spanish, German and Portuguese.
    When I put special characters in the import string file they showed up as ? (question mark)
    The import strings file includes the following parameters for each string: font, text, size and style. (but no field for script)
    In order to use a unicode font such as Arial I need to select a french script. But this option is not supported bu LabView (As far as I saw)
    A) Is there a font which is directly German/ French etc and not regula font + script parameter?
    B) Are there another required step
    s for special characters support? (When I put speciual characters in the import string file the showed up as ? question mark)

    This was discussed last week in this group- read the previous messages.
    Look for the thread "Foreign Languages in Labview"
    And recite the mantra
    ActiveX is good
    ActiveX is holy
    All Hail Bill
    Those who claim otherwise are heretics and not to be trusted
    Actually, in this case the non-ActiveX suggestions may be good.
    talia wrote in message
    news:[email protected]..
    > How can I display special characters of NonEuropean languages (French,
    > Italian, Spanish, German and Portuguese.) using import string
    > mechanism

  • How can i create  excel sheet with multiple tabs using utl file?

    how can i create excel sheet with multiple tabs using utl file?
    any one help me?

    Jaggy,
    I gave you the most suitable answer on your own thread yesterday
    Re: How to Generating Excel workbook with multiple worksheets

  • How can I change excel column header using Labile.

    Dear Experts,
                          How can i change excel column header using LabVIEW.
    Thanks for any and all help!
    M.S.Sivaraj.
    Sivaraj M.S
    CLD

    As I said in my previous post, column headers in Excel are merely row 1 cells. May be I missing something here, so please be more explicit with your question.
    I guess you are using the Excel Report tools, and you want to modify an existing sheet. From my limited experience with the Excel Report tools, it is not possible to open an existing woorkbook (except as template...), so the answer to your question should be "Forget it"...
    The work around is to use the example I pointed for you before, and either to write the whole new colum headers as a string array, starting in A1, or to write a single string to a given cell in row 1.
    Hope this helps 
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • How can I display current iPhone GPS coordinates using compass app

    How can I display current iPhone GPS coordinates, when traveling overseas with no access of data or wifi
    using "iphone compass app"(Both the latitude and longitude) ??
    if iphone compass app require any sort of data
    what alternative would there be? (to document the coordinates)?

    Hi
    Iphone 5s 16 gb 8.1
    My fone freeze whenever i charge my fone its appear white screen with apple logo.. and as soon as i try to press hold home and power button
    it shows battery drained sign>> i m facing this problem from last one week
    and itunes also not  getting cconnected
    can any1 please help me out
    sorry for poor english

  • How can I display total playlist size in iTunes 11.  It used to be visible for each playlist or CD, but I can't find it now.

    How can I display total playlist size in iTunes 11.  It used to be visible for each playlist or CD, but I can't find it now.

    The Friend: Thanks from me too for that super simple fix!! I feel kinda stupid for not knowing that.
    Too bad Apple didn't:
    Give it a more intuitive name than "Status Bar"... "status" is what is shown at the top of the window along with the Artist and Song Title, e.g.; how far into the song/podcast/video I've played and how much is left,
    Put the keyboard commands in a more prominent place in their release notes when version 11 came out so we could more easily find the information they decided to hide in this attempt to make the desktop less cluttered and
    Allow us the option of displaying the data size along with the song count and duration just beneath the playllist title. The status bar is a redundant listing of information except for the data size!  Poorly conceived!
    Perhaps Apple will remedy this in a future release. For those of us who like to burn our playlists to CD, DVD and even a thumb drive this information is essential. WIthout it, we're left to guess whether a given playlist will fit on our target device.
    Thank you!

  • How can we display svg files in flex at runtime using FileReference? Actually we are trying to load

    how can we display svg files in flex at runtime using FileReference? Actually we are trying to load the svg file from the  local directory.

    This should give you the JRE version;
    System.out.println(System.getproperty("java.version"));
    and this should tell you where its running from;
    System.out.println(System.getProperty("java.home"));
    There are loads more system properties, check the JDK documentation for java.lang.System and look at the getProperties method which has a list.
    Stewart

  • How can I display XSLT transformer errors on a web page ?

    Hi,
    I have some JSP pages that access DB, create an XML based on DB data and then transform it into HTML through an XSLT stylesheet. Developing the XSL code it's easy to make mistakes and generate errors on trasformation, but what I receive on the web page is only a "Could not compile stylesheet" TransformerConfigurationException, while the real cause of the error is displayed only on tomcat logs. This is the code for transformation:
    static public void applyXSLT(Document docXML, InputStream isXSL, PrintWriter pw) throws TransformerException, Exception {
            // instantiate the TransformerFactory.
            TransformerFactory tFactory = TransformerFactory.newInstance();
            // creates an error listener
            XslErrorListener xel = new XslErrorListener();
            // sets the error listener for the factory
            tFactory.setErrorListener(xel);
            // generate the transformer
            Transformer transformer = tFactory.newTransformer(new SAXSource(new InputSource(isXSL)));
            // transforms the XML Source and sends the output to the HTTP response
            transformer.transform(new DOMSource(docXML), new StreamResult(pw));
    }If an exception is thrown during the execution of this code, its error message is displayed on the web page.
    This is the listener class:
    public class XslErrorListener implements ErrorListener {
        public XslErrorListener() {
        public void warning(TransformerException ex) {
            // logs on error log
            System.err.println("\n\nWarning on XEL: " + ex.getMessage());
        public void error(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nError on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
        public void fatalError(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nFatal Error on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
    }When I have an error in the XSL stylesheet (for examples a missing closing tag), I can find on tomcat logs the real cause of the error:
    [Fatal Error] :59:10: The element type "table" must be terminated by the matching end-tag "</table>".
    Error on XEL: The element type "table" must be terminated by the matching end-tag "</table>".but on my web page is reported just the TransformerConfigurationException message that is:
    "Could not compile stylesheet".
    How can I display the real cause of the error directly on the web page?
    Thanks,
    Andrea

    This code is part of a bigger project that let developers edit XSL stylesheets through a file upload on the system and we can't impose the use of any tool for checking the xsl. So, I need to display the transformer error on the web page.I see. This code is part of an editorial/developmental tool for developers to create and edit XSL stylesheets.
    As part of the editorial process, XSL errors during editing can be considered a normal condition. In other words, it is normal to expect that the developers will generate XSL errors as they are developing stylesheets.
    In this light, handling the XSL transformation errors is a business requirement that you need to handle. Using the Java Exceptions mechanisms, e.g. try / catch are inappropriate to handle business requirements, in my opinion.
    I suggest that you look at how you handle the occurence of XSL errors differently than what you currently have. You need to:
    (1) capture the Transformation exception on the server;
    (2) extract the message from the exception and put it into a message that can be easily understood by the user;
    The current error message that you have going to the web browser is not useful.
    And you should not have the Transformation exception sent to the web browser either.
    What you are attempting to do with the exception is not appropriate.
    Handle the Transformation exception on the Business tier and use it to create a useful message that is then sent to the Presentation tier. In other words, do not send Java exceptions to web browser.
    />

Maybe you are looking for

  • Need to find out how many users are using Siebel Application

    Hello all, I need to find out how many users are using Siebel Application? Is there a way I can find out? Thanks. yasun

  • Footer in Word printed output

    I want to prevent RoboHelp's topic footer from appearing in the printed Word output, where it shows as part of the page text (not in the Word document's footer). I use a RH template to add the same footer to every topic in the WebHelp output but I do

  • Flash CS3 doesn't show some fonts.

    Some fonts that I'm trying to use in Flash CS3 aren't showing up. Specifically, these fonts are Peter Saville's New Order line of different typefaces. Font Book only shows errors for one of the fonts (N.O.– Movement). This is the specific font I want

  • Pass VISA resource to DLL created by CVI

    Hi, I want to call a DLL created by Labwindows CVI in Labview. When I use ' Call Library Function Node', I have to define the parameters output in DLL. However, there is one 'VISA Resource' type parameter and I don't know which shoudl be the right in

  • Version Problem - Upgrade

    Hi, Now we are upgrading the system from 4.6C to ECC6. I am just analysing the total workflow in the system with SWE2 transaction. The problem is , i am seeing multiple version of workflows 0,1,2,3,4,5. Which version of workflow i need to consider ,