none
How to convert an excel sheet to an txt file using an excel addin button

    Question

  • I am trying to creat an excel addin button that will export an excel sheet into a txt file in vb. Have no idea how to get it started.. hoping someone out there can help get me started.

    Thanks

    Thursday, August 01, 2013 7:56 PM

Answers

  • VBA is a subset of VB with in-built support for Office automation.

    From a VB project you can simply use all codes but you first need to refer an excel object (

    dim XL as object

    set XL=CreateObject("Excel.Application")

    )

     and then use wherever I used Excel object model.

    Suppose I used

    set WB=Activeworkbook

    you use

    set WB=XL.Activeworkbook.


    Best Regards,
    Asadulla Javed, Kolkata
    ---------------------------------------------------------------------------------------------
    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Saturday, August 03, 2013 8:50 AM
    Answerer
  • http://sdrv.ms/13Alwux

    A file named text.xls.

    First download it and then right click any cell.You find a command named "Convert To text" at bottom of menu.This will convert the activesheet to text file.

    If you are satisfied then save the file as add-in so that the command available to all excel files..


    Best Regards,
    Asadulla Javed, Kolkata
    ---------------------------------------------------------------------------------------------
    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Friday, August 02, 2013 9:15 AM
    Answerer

All replies

  • http://sdrv.ms/13Alwux

    A file named text.xls.

    First download it and then right click any cell.You find a command named "Convert To text" at bottom of menu.This will convert the activesheet to text file.

    If you are satisfied then save the file as add-in so that the command available to all excel files..


    Best Regards,
    Asadulla Javed, Kolkata
    ---------------------------------------------------------------------------------------------
    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Friday, August 02, 2013 9:15 AM
    Answerer
  • Thanks hhis was pretty helpful... I tried it and it worked most times the way I wanted it to , but this a project for an online course that I am taking so  I need to code the solution in VB.. I was wondering if you can point me in the right direction of at least how to get started.  

    Thanks for your help

    Friday, August 02, 2013 3:42 PM
  • VBA is a subset of VB with in-built support for Office automation.

    From a VB project you can simply use all codes but you first need to refer an excel object (

    dim XL as object

    set XL=CreateObject("Excel.Application")

    )

     and then use wherever I used Excel object model.

    Suppose I used

    set WB=Activeworkbook

    you use

    set WB=XL.Activeworkbook.


    Best Regards,
    Asadulla Javed, Kolkata
    ---------------------------------------------------------------------------------------------
    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Saturday, August 03, 2013 8:50 AM
    Answerer
  • Thank you very much, you have been very helpful.. I am a beginner in programming in the VB language; I am not sure I understand what you mean with the code above. Let me better explain what I am trying to do..

    I need to create a ribbon with a button that when pressed will convert the excel spreadsheet into txt file (much like the text.xls file that you provided does); I already have the ribbon and button design set up in visual studio, my question would be: where does the code that you provided go in Visual Studio?

    Again thanks for your help it is greatly appreciated.

    Monday, August 05, 2013 3:00 PM
  • Dear Respected Contributors and Moderators,

    Pls look into this and do the required help related with Visual Studio.

    Thanks.


    Best Regards,
    Asadulla Javed, Kolkata
    ---------------------------------------------------------------------------------------------
    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Wednesday, August 07, 2013 9:27 AM
    Answerer