If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Not able to export XML via code

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-27-06, 15:59
jrn0074 jrn0074 is offline
Registered User
 
Join Date: Aug 2003
Posts: 123
Not able to export XML via code

I have a list in a spreadsheet mapped to an XML schema. I would like to export it to an xml file using a button and code. However, I keep getting the error "Method 'Export' of object 'XmlMap' failed". This happens using the code generated from recording the process as a macro:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11/27/2006
'
' Keyboard Shortcut: Ctrl+Shift+O
'
ActiveWorkbook.XmlMaps("BloombergFXRates").Export URL:= _
"H:\MontreSys\Montre_v20\import\bbfx_daily.xml "
End Sub

In other words, if I do the steps manually (right-click on the list, select XML...Export, and select the file path) it works fine. But if I record it as a macro or try to call the code from a button Click event, I get the run-time error above.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On