473,395 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Vbs Importing XML into Excel problem

I have an excel/vba project I've been working on and run into some trouble importing a xml file to my workbook. The existing xmlmap is valid and the xml file imports when using the import xml under the Data dropdown menu however it fails to import using the vbs script I've written. I use the default schema as the xmlmap is very simple and have come across a page from microsoft here that mentions that I have to unwrap certain objects when the ExcelLocale1033Attribute is set to true. The syntax however, eludes me. Here's what I'd like to insert the proper code into:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CommandButton10_Click()
  2. fileToOpen = Application _
  3.     .GetOpenFilename("XML Files (*.xml), *.xml")
  4. ActiveWorkbook.XmlImport(Data:=fileToOpen,ImportMap:=Estimate)
  5. End Sub
May 7 '07 #1
1 4303
SammyB
807 Expert 512MB
I have an excel/vba project I've been working on and run into some trouble importing a xml file to my workbook. The existing xmlmap is valid and the xml file imports when using the import xml under the Data dropdown menu however it fails to import using the vbs script I've written. I use the default schema as the xmlmap is very simple and have come across a page from microsoft here that mentions that I have to unwrap certain objects when the ExcelLocale1033Attribute is set to true. The syntax however, eludes me. Here's what I'd like to insert the proper code into:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CommandButton10_Click()
  2. fileToOpen = Application _
  3. .GetOpenFilename("XML Files (*.xml), *.xml")
  4. ActiveWorkbook.XmlImport(Data:=fileToOpen,ImportMap:=Estimate)
  5. End Sub
Your reference only applies to .NET applications. You won't need to do any of this in VBA. Two suggestions:
  1. Look at the return code from XmlImport
  2. Provide a destination range (the upper-left corner) parameter for XmlImport
May 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Little PussyCat | last post by:
Hello, I nee to write something that will transfer excel data into an SQL Server table. I have for another database application I wrote have it importing Excel spreadsheet data using cell by...
9
by: jillandgordon | last post by:
I am trying to import an excel file into Access 97. It looks perfectly all right but, every time I try to import it, I get to the lst step and am told that it was not imported due to an error. ...
6
by: Michael Peters | last post by:
the Excel data that I would like to import into Access sometimes contain line breaks, like this: 623 749 in one cell. In Access, the imported data looks like this then: 623749
2
by: WODJ | last post by:
Folks, I hope someone out there can please help me, not much hair left with this one. I'm importing excel data into a SQL server database using an Oledb connection in C#. The problemm is that...
4
by: andrewmac | last post by:
I hope someone can help - I am new to Access so please be patient. I have a list of about 100 equity tickers in a column in Excel formatted as Text. I am trying to copy and paste into a field...
3
by: Vardhini Gold | last post by:
Hi, I am Vardhini. The project that I am working for is a web based application. I use ASP.2.0/ VB.NET (Visual studio 2005). Kindly help me in importing excel contents to SQL Database using...
1
by: christiekp | last post by:
I am able to import a file from excel to access manually, using the top row as my headings, successfully. however, when using the TransferSpreadsheet command in a macro, importing, excel 5-7, has...
0
by: Shootah | last post by:
Hi, I have succeeded in adding automated relationships with refference tables after importing an excel file created from a query to an Access database. However I have the following problem: ...
0
by: mustaqueahmad | last post by:
Hi All, I am getting export to excel problem when I am giving IPAddress in URL, but it is working correct when am giving localhost and page name. eg : when I am writing My machine IP...
6
by: ronparker | last post by:
Hello, This is my first time posting and just my second day using python on mysql, so please be patient with me. I should also say, I am using a linux machine. Using python I was able to make a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.