Unable to transfer CSV file to Excel sheet automatically

Status
Not open for further replies.

gurunathblessings

New Member
Joined
Sep 15, 2016
Messages
22
Hi,

I have been trying to add this CSV data to excel using the following VBA code but could not.

Anyway, I only require the first date with the adjacent details. Meaning I only require 2018 Sep 10 details. I am studying about comets and there are about 993 comets being identified. Meaning Cell A2 contains details of one comet for 2018 Sep 10 and Cell A3 should contain details of another comet but for the same date. I was trying to create a code for different date options but could not. As for now, I need not worry about the 993 comets. All I need to transfer one data successfully. I could able to the next.

Here is the code I have been trying to use.
HTML:
Sub Comets
Dim IE As New InternetExplorer
'IE.Visible=True
IE.navigate "https://in-the-sky.org/ephemeris.php?startday=10&startmonth=9&startyear=2018&ird=1&irs=1&ima=1&iph=0&ias=0&iss=0&iob=1&interval=0&tz=0&format=csv&objtype=3&objpl=21P%2FGiacobini-Zinner&objtxt=21P%2FGiacobini-Zinner
Do
 DoEvents
Loop Until IE.readyState=READYSTATE_COMPLETE
Dim Doc As HTMLDocument
Set Doc=IE.document
End Sub

My code could work until Set Doc=IE.document and nothing been transferred to the excel worksheet.
I am fully aware that my codes could be wrong or incomplete. My knowledge of VBA is very very limited.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Status
Not open for further replies.

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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