Jump to content

Trouble handling html table in Excel


Recommended Posts

Hi,

I have some code that creates a html table on the fly. Ideally I would like to export this table from my webpage as an excel spreadsheet. I have tried saving the table from IE as a html file and then opening that file in Excel. It displays perfectly but no matter what I seem to do (including converting the cells to number format) I can not do maths operations on the cells i.e. I can't add a list of my cells together. Am I going about it the wrong way? Perhaps there's a bit of javascript that will export the table to something excel friendly or maybe there is a way to the math operations on html tables in excel?????

Please help with any suggestions. Thanks as always,

SD

Link to comment
Share on other sites

Not sure what your problem is. Are these math operations already present in the HTML table (how?), or are they added later in the converted Excel sheet?

We have some members here with pretty good Excel knowledge; just wait until they sign in (UK time).

Link to comment
Share on other sites

The math operations are added after the file is brought into excel. I save the file from IE doing 'save as' selecting the html only option. I then open the .htm file in excel. I convert the format of the relevant cells to number and try to add two cells together. All I get is the #VALUE! error.

I did try to save the .htm as a .xls file in excel and then reopen but i get the same errors.

I have attached a sample .htm file downloaded from my site.

Please let me know if you need more clarification.

Thanks,

SD

test_report_01.htm

Link to comment
Share on other sites

In my experience, the #VALUE! error is when it is formatted as a text field.

Perhaps you could try touching the top of each column, then format the whole column as a number as appropriate. i.e. whole number, decimal places etc.

Link to comment
Share on other sites

Thanks for your reply but I tried that but it does not format the cells at all. Try it on the previously attached file and you'll see what I mean.
Sorry, but I can't interact with your attachment at all. :(

Could you point me to an example of the table actually in IE which you are trying to save from?

It just occurred to me that you may be including the text header, patination in the SUM formula. That is probably a basic thing to suggest, so please accept my appology in advance.

Link to comment
Share on other sites

Phew!!! :blink:

What do you think of this....

The procedure I used was:

  1. On the web page - Edit - Select All - Save As a .txt file.
  2. I then opened Word, specifying 'All Files' at the bottom of the 'Open' dialogue box. This allowed me to load the table into a Word document.
  3. Now 'Insert' an Excel table into the Word dcument.
  4. Highlight the data in the table by right-click across the top of the columns (you see a small arrow pointing downwards at the top of each column.
  5. Now right-click in the centre of the table and from the small menu select copy.
  6. Next double click the inserted excel spreadsheet to activate it. Touch the top lefthand cell, right-click on the cell, then paste. The data is now in the spreadsheet.
  7. Now it is possible to add the column headed 'Pagination'. B)

:D ... not sure if this may be too lengthy for your needs!!

Link to comment
Share on other sites

I must admit, it was rather long winded!! :rolleyes:

My final suggestion is...

In IE, if you go into Tools, Internet Options, Programs.

The top option is to select the program which is used as HTML Editor.

I have not tried this one myself.

Good Luck! :D

If it doesn't work, maybe someone else might have some ideas.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy