Can any one tell me how to assign a worksheet as the xml source?

EDUCATED MONKEY

Board Regular
Joined
Jul 17, 2011
Messages
218
The set up is office 2007 windows XP professional IE8<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
At present I have an HTTP string which I dispatch via InternetExplorer.application the data is then sent back as xml and is pasted in the column A
This bit work fine. <o:p></o:p>
The part I am having problems with is using the from xml data import option,on the from other sources tab, if I manualy save the xml file to drive C then locate it as part of the import everything works perfectly<o:p></o:p>
So what I need to do is make the worksheet the source then it will accomplish the task


Rich (BB code):
Sub XMLCONTROL()
Rich (BB code):
Rich (BB code):
'
' XMLCONTROL Macro
'
' Keyboard Shortcut: Ctrl+Shift+Z
'
Dim Q As String
Dim aurl As String
Dim EXP
 
 
                                 aurl = Worksheets("CONTROL").Range("C2").Value ' pass HTTP string in
 
 
                      Set EXP = CreateObject("InternetExplorer.application")
                                 EXP.Visible = True
                                      EXP.Navigate (aurl)
 
                  Application.Wait (Now + TimeSerial(0, 0, 5))
                                  SendKeys "^a"
                                  SendKeys "^c"
                 Application.Wait (Now + TimeSerial(0, 0, 5))
 
                         Worksheets("TEST XML").Activate
                         Worksheets("TEST XML").Range("A1").Select
   ActiveSheet.PasteSpecial Format:="Text", LINK:=False, DisplayAsIcon:= _
       False
 
Call CloseIE
 
End Sub 
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Thanks will do

pete
Hello followed your advice, it seems there are a lot of terms that I have not come across as of yet, do you know of an example that I could look at?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
As I have got very confused with it all, <o:p></o:p>
<o:p> </o:p>
What I need do is send a HTTP string to a web server and deal with the retuned xml<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
Another idea I had was to get vba to save the web page, using the save as and taking part of the returned heading of that page as the file name of course this would need to save it as an xml file
Looking at the problem in a different way when the page is open on my desk top pc I can click file then save as the dialog box then requires a name and a location to save the file? Then get vba to mimic my actions to accomplish the task.
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

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