473,786 Members | 2,407 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vbs Importing XML into Excel problem

2 New Member
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 ExcelLocale1033 Attribute 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 4322
SammyB
807 Recognized Expert Contributor
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 ExcelLocale1033 Attribute 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
4704
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 cell, row by row method. This is fully automated so the user can choose whatever spreadsheet they want to import and press a button which sits on a VB6 frontend. This has been good for that situsation but it can be very slow when there
9
3920
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. There is no further explanation. What are the kinds of things that make this happen? Thanks from an obvious rookie. Gordon
6
2772
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
2669
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 some of the rows returned to c# are giving null values, when there is a value in it in the original xl document. If you know what I mean. Please help DataTable dt=new DataTable();
4
8076
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 in a table in Access with Text data type. For some reason Access only wants to paster the first 3 records. Can anyone please help me? Thanks in Advance
3
1985
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 .NET Thanks and Regards, Vardhini.
1
2478
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 field names is YES, the file comes thru with all the alpha heading correct but the last few are years, 1998, 1999 etc and they come thru as F8, F9 etc. (however they come thru fine when I import manually) HELP!
0
1621
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: When there are values in the excel file which was imported that do not appear in the refference tables because they are not entered yet, or in case they are misspelled, the code blocks and gives me an error message. As I am not that much of a coding...
0
1567
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 address and aspx pagename like 192.xxx.xxx.xx/exporttoexcell.aspx then popup page is not working. the popup page is being closed automatically , and export to excel option is not comming. for some reason when it opens within a scripted popup (js:...
6
7395
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 database and a table. However, I am having difficulty getting the values from an excel and putting them into the table. The Excel document has just three columns, which are: MATCH - this is just a four digit number DATE - this is just a date in the...
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10108
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9960
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4064
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.