dimanche 31 mars 2019

Uploading material to the Web with VBA

I am not proficient in English. I'm sorry. I want to copy two tables, ListObjects ("Tbl1") on Sheet1, ListObjects ("Tbl2") on Sheet2, and upload them as a single post on the web. The range of the table can be changed every time. Logging in to the web, navigating to the bulletin board, pressing the write button and typing the title succeeded. But I have failed to upload the post. Perhaps it seems that you can not find the bulletin board object. Please help me with what to do. Below is my code I created by searching the web.

With ie
    .navigate "http://my_URL/offering"
    ieBusy ie   'Procedure fetched as search (check the ready status)

    .Document.getElementsByClassName("ico_16px write")(0).Click
    ieBusy ie

    Dim oTitle As Object, Ocontents As Object

    Set oTitle = .Document.getElementsByname("title")(0)   'Sometimes fail(sometimes Nothing)
    Set oContents = .Document.getElementsByClassName("xe_content editable")(0) 'evry time fail(=Nothing)

    oTitle.Value = "my Title"
    oContents.Value = ????
    .Document.forms(0).submit   'I could not confirm it because it did not work anymore.

End With


title HTML

board HTML




Aucun commentaire:

Enregistrer un commentaire