Conflict between innertext date time and excel date time output

MarceloPBG

New Member
Joined
Apr 4, 2017
Messages
1
Hello,

I need help scraping information from InternetExplorer to an Excel Workbook .
When i scrap, information in the innertext property is correct, but in the excel it comes wrong.
Using the code:

Workbooks("Automatizar PSA").Sheets(1).Cells(linha, 5).Value =
ie.Document.getelementsbyclassname("tr-visualizar-detalhes text-center")(i + 1).innertext

I think this is caused because they assume diferent variables, i used variable inspection and got:

Watch : : ie.Document.getelementsbyclassname("tr-visualizar-detalhes text-center")(i + 1).innertext :
"06/04/2017 11:09 " : Variant/String : Módulo11.PSAScrap

Watch : : Workbooks("Automatizar PSA").Sheets(1).Cells(linha, 5).Value :
04/06/2017 11:09:00 : Variant/Date : Módulo11.PSAScrap

Any help, how can i fix that? Sorry for the way i posted, not familiar with forums, how can i paste it as code?
Thank you!!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Excel is converting the date string into an excel date, which is a serial number with a fraction. To keep the input date append a single quote to the front of the string:
dim opDate as String
opDate = "'" & yourScrapedDate

Some problems happen when an invalid date is input. You may need to handle these exceptions.


My experience of many years of date processing is that it is best to stay with the Excel date format. You may want to keep both formats in your output spreadsheets.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top