Results 1 to 10 of 52

Thread: ब्लॉग कोशिश कर रहा है بلاگز کی ک*Trying Blogs

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #29
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10

    Excel File (range) SaveAs .htm ( Publish Excel Range )

    Excel File (range) SaveAs .htm

    As noted in the previous post, we can simply save an existing Microsoft Word or Excel file with the extension .htm
    For a Word file there is not much more to it than that: the entire file is saved in a HTML code format, ( https://tinyurl.com/yash9gta
    SaveAs Word.JPG Save As Word doc to htm.JPG https://imgur.com/h7XFAQX , https://imgur.com/vhRE9CC
    )

    In this post , the case of an Excel file saved as .htm format is considered. In this case, if a range is selected before the SaveAs .htm, then at the Save action , an additional dialogue box comes up.
    Consider us saving the header range:
    Using Excel 2007 32 bit
    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    2
    Machine EQ.ID
    Manufacture
    Model
    Description
    Serial Number
    Weekly
    Date of Service
    Weekly
    Next Service
    Monthly
    Date of Service
    Monthly
    Next Service
    Quarterly
    Date of Service
    Quarterly
    Next Service
    Worksheet: Equipment PM

    SaveAs.jpg : https://imgur.com/ISfW7tH
    SaveAshtm.jpg: https://imgur.com/muyoVqQ

    After selecting .htm and Save for an Excel File, another Dialogue box pops up.
    ExcelDialogueBoxRangeSelect htm.JPG : https://imgur.com/14iF2SM
    At this point no file has been saved. One can see that one can choose to just save the selected Range, in this case, 'Equipment PM'!$A$2:$K$2

    On attempting to save a second time, another Dialogue box pops up , which I don’t quite understand, _...
    PublishExcelRange.JPG : https://imgur.com/6b5TV9j
    _.. but on hitting Publish, the File appears to be saved:
    SavedExcel htm.JPG : https://imgur.com/WapD7Sa
    _.....

    Examining saved htm file
    A noted, such a file can be directly sent as the main body of an Email sent. This is commonly done.
    I prefer not to do that.

    My way of doing this is to examine the file and look for the relevant HTML coding which I need. In this case I need information about that spreadsheet range 'Equipment PM'!$A$2:$K$2

    To simply examine the file, I open it with a simple text editor, ( and for convenience save it as such also )
    RightClickOn htmFile OpenWithTextEditor.JPG : https://imgur.com/OpKEf8o
    SaveAs txt File.JPG : https://imgur.com/ab1gXN8
    Saved as Txt File.jpg. : https://imgur.com/ohhQ7td
    Here is that File : “Equipment- Maint Records A2-K2 Header.txt” : https://app.box.com/s/uk3qnvuxizm10bvwoye1epg2zi1fs8qz

    I am not an HTML expert, but with a bit of common sense , I start examining the code and looking for info relevant to an 11 cell row, A2-K2

    This part looks promising:
    HTML Code:
    <tr class=xl18712769 height=64 style='mso-height-source:userset;height:48.0pt'>
      <td height=64 class=xl18312769 width=80 style='height:48.0pt;width:60pt'>Machine
      EQ.ID</td>
      <td class=xl18412769 width=207 style='width:155pt'>Manufacture</td>
      <td class=xl18512769 width=113 style='border-left:none;width:85pt'>Model</td>
      <td class=xl18612769 width=143 style='border-left:none;width:107pt'>Description</td>
      <td class=xl18512769 width=158 style='width:119pt'>Serial Number</td>
      <td class=xl19012769 width=115 style='border-left:none;width:86pt'>Weekly
        <span style='mso-spacerun:yes'> </span>Date of Service</td>
      <td class=xl19012769 width=97 style='border-left:none;width:73pt'>Weekly
        <span style='mso-spacerun:yes'> </span>Next Service<span
      style='mso-spacerun:yes'> </span></td>
      <td class=xl19112769 width=154 style='border-left:none;width:116pt'>Monthly
        Date of Service</td>
      <td class=xl19112769 width=154 style='border-left:none;width:116pt'>Monthly
      
        Next<span style='mso-spacerun:yes'>  </span>Service</td>
      <td class=xl18812769 width=161 style='border-left:none;width:121pt'>Quarterly
        Date of Service</td>
      <td class=xl19312769 width=161 style='width:121pt'>Quarterly 
        Next Service</td>
    Information that looks like it might be relevant is
    _ The reference to widths
    80
    207
    113
    143
    158
    115
    97
    154
    154
    161
    161

    _ The reference to a “class”. If I look further in the code then I can glean some info about the background colour associated with those “classes” .
    Class info in HTML text file.JPG : https://imgur.com/JmZdzmx
    So this looks like the final 11 cell (column) information that could be relevant:
    80
    207 #D8D8D8
    113
    143 #D8D8D8
    158
    115 #92D050
    97 #92D050
    154 yellow
    154 yellow
    161 #D8D8D8
    161 #D8D8D8


    _._____________


    Modifying code for Formatted header
    Currently no header is included in the sent HTML string.
    So it is convenient to construct a header manually as an addition to the start of the HTML string to be .Sended

    This will be done in the next post
    Last edited by DocAElstein; 06-13-2018 at 02:22 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •