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:eek:ffice:eek:ffice" /><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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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:eek:ffice:eek:ffice" /><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
I don't have any specific examples other that what you could find with a web search.
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,947
Members
449,480
Latest member
yesitisasport

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