PC Review


Reply
Thread Tools Rate Thread

Data importing prob

 
 
mohan
Guest
Posts: n/a
 
      21st Mar 2008
Hi,

I'm trying to get data imported from website to excel.

The link.
http://www.douanes.ci/Services/Grppr...MaJ=29/02/2008

This is code 01 to 97 is called chapter wise data.
Click 01 data will come.
How can i extract hole data in one shot. (01 to 97)

Does anyone know a way
arround it? Anything would help.

Thanks!
Yours loving friend
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      21st Mar 2008
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 3/21/2008 by jwarburg
'

'
With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://www.douanes.ci/Services/Grpproduit.asp?DateMaJ=29/02/2008", _
Destination:=Range("A1"))
.Name = "2008"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "5"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

End Sub


"mohan" wrote:

> Hi,
>
> I'm trying to get data imported from website to excel.
>
> The link.
> http://www.douanes.ci/Services/Grppr...MaJ=29/02/2008
>
> This is code 01 to 97 is called chapter wise data.
> Click 01 data will come.
> How can i extract hole data in one shot. (01 to 97)
>
> Does anyone know a way
> arround it? Anything would help.
>
> Thanks!
> Yours loving friend
>

 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      21st Mar 2008
I modified the code to get the actual data. The access to the webpage is
slow. Below the code gets the first 3 chapters. Modify the code from 1 to 3
to 1 to 97 to get all the pages. The code creates a new worksheet for each
chapter. I you run the code more than once it will give you an error because
you are creating the same worksheet more than once.

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 3/21/2008 by jwarburg
'

'
For chapt = 1 To 3
Worksheets.Add after:=Sheets(Sheets.Count)
ChaptNum = Format(chapt, "0#")
ChaptName = "Chapter " & ChaptNum
ActiveSheet.Name = ChaptName
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.douanes.ci/Services/resultpchap.asp?code=" & _
ChaptNum & "&DateMaJ=29/02/2008" _
, Destination:=Sheets(ChaptName).Range("A1"))
.Name = "2008"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "5"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Next chapt
End Sub

"mohan" wrote:

> Hi,
>
> I'm trying to get data imported from website to excel.
>
> The link.
> http://www.douanes.ci/Services/Grppr...MaJ=29/02/2008
>
> This is code 01 to 97 is called chapter wise data.
> Click 01 data will come.
> How can i extract hole data in one shot. (01 to 97)
>
> Does anyone know a way
> arround it? Anything would help.
>
> Thanks!
> Yours loving friend
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      21st Mar 2008
Or you could create the webfetch and then use a loop to refresh the ONE
fetch and copy info to another page(s).
with sheets("getdat").querytables(1)
Then you only have one fetch and one external name and you only need the
..refresh background line


For i = 1 To 97
chaptnum = Format(i, "0#")
With Sheets("getdata").QueryTable(1)
.Connection = _
"URL;http://www.douanes.ci/Services/resultpchap.asp?code=" &
chaptnum & "&DateMaJ=29/02/2008"
.Refresh BackgroundQuery:=False
End With

'copy data somewhere

Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Joel" <(E-Mail Removed)> wrote in message
news48513B9-5775-4970-8E6E-(E-Mail Removed)...
>I modified the code to get the actual data. The access to the webpage is
> slow. Below the code gets the first 3 chapters. Modify the code from 1
> to 3
> to 1 to 97 to get all the pages. The code creates a new worksheet for
> each
> chapter. I you run the code more than once it will give you an error
> because
> you are creating the same worksheet more than once.
>
> Sub Macro2()
> '
> ' Macro2 Macro
> ' Macro recorded 3/21/2008 by jwarburg
> '
>
> '
> For chapt = 1 To 3
> Worksheets.Add after:=Sheets(Sheets.Count)
> ChaptNum = Format(chapt, "0#")
> ChaptName = "Chapter " & ChaptNum
> ActiveSheet.Name = ChaptName
> With ActiveSheet.QueryTables.Add(Connection:= _
> "URL;http://www.douanes.ci/Services/resultpchap.asp?code=" & _
> ChaptNum & "&DateMaJ=29/02/2008" _
> , Destination:=Sheets(ChaptName).Range("A1"))
> .Name = "2008"
> .FieldNames = True
> .RowNumbers = False
> .FillAdjacentFormulas = False
> .PreserveFormatting = True
> .RefreshOnFileOpen = False
> .BackgroundQuery = True
> .RefreshStyle = xlInsertDeleteCells
> .SavePassword = False
> .SaveData = True
> .AdjustColumnWidth = True
> .RefreshPeriod = 0
> .WebSelectionType = xlSpecifiedTables
> .WebFormatting = xlWebFormattingNone
> .WebTables = "5"
> .WebPreFormattedTextToColumns = True
> .WebConsecutiveDelimitersAsOne = True
> .WebSingleBlockTextImport = False
> .WebDisableDateRecognition = False
> .WebDisableRedirections = False
> .Refresh BackgroundQuery:=False
> End With
> Next chapt
> End Sub
>
> "mohan" wrote:
>
>> Hi,
>>
>> I'm trying to get data imported from website to excel.
>>
>> The link.
>> http://www.douanes.ci/Services/Grppr...MaJ=29/02/2008
>>
>> This is code 01 to 97 is called chapter wise data.
>> Click 01 data will come.
>> How can i extract hole data in one shot. (01 to 97)
>>
>> Does anyone know a way
>> arround it? Anything would help.
>>
>> Thanks!
>> Yours loving friend
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prob/Suggestion with importing from ACT9 rlove Microsoft Outlook BCM 0 28th Apr 2008 03:50 PM
Prob with Chart>Source Data>Data Range =?Utf-8?B?TWlrZVp6?= Microsoft Excel Charting 3 6th Feb 2007 06:02 PM
Importing data from Access into Excel: prob w/ cutting off fields =?Utf-8?B?Tmljb2xlIEwu?= Microsoft Excel Worksheet Functions 1 7th Feb 2005 10:05 PM
prob w/Access 97 and XP and importing Excel files Sadlebred Microsoft Access External Data 0 21st Jun 2004 02:22 PM
Prob. Importing/Exporting dBase files Scott Microsoft Access External Data 0 25th Jun 2003 07:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:32 AM.