vba excel to html

  • hi dears

    i have excel with 10 sheets and i need vba for convert to 1-html format and 2-csv comma utf8 and 3.txt format

    1-do it for entire workbook automatically and with no question

    2-for each sheet make seperate file name and same as sheet name in my excel file path

    3- printarea by default selected for each sheets , for convert

    thx dear

  • Please read the Forum Rules before continuing.


    All example workbooks should be attached to the post, not shared with an external file sharing service.

  • What do you want to do with an html version?



  • thx

    there is 2 issue


    1-for csv vba :

    a) i need make file in same as directory of file.xlsm


    2-for html

    a)i need exact .html export but this code prepare mhtml and must change to html . thx

    b)i need for each sheet make seperate file name and same as sheet name but this vba make book1.html and etc ......

    c)i need make file in same as directory of file.xlsm

  • Well if you've found the code then try it.


    Also, why do you need html?

    i have online store and from excel change the price and then convert to html and pdf and then show on my site . i want to show with html because it is very lower size and more mobile friendly and responsive . i have a plugin for show table on my site that only work with csv and html format

  • I think this is on the right track.


    I've amended the csv code and found & adapted some code to publish to html.


    They will be created in the same folder as the workbook, but you need to add a subfolder and name it HTML


  • for csv is okey


    for html , have error

    in line : Call PublishOnWeb

    compile error

    sub or function not defined

  • this is code for produce html and only need to 1-repeat for entire workbook and 2-printarea by default selected for each sheets for convert and 3-html name is same as sheet name

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!