Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

leer xml con excel

publicado

Por favor necesito ayuda, es un xml que tiene 4 conceptos distintos y quiero descargar cada concepto en cada celda de excel perome marca error en la palabra cfdi y quisiera solucionarlo

image.thumb.png.8a4cba9d540f696e2184ee6a7a25fea1.png

es este error

image.png.13c1d0364a4db14b9d18f8151d1c08cf.png

le doy click en depurar y asi aparece

image.thumb.png.34a2793cbbbdcccd7c706a42d0adf6f6.png

se los agradeceria mucho

Featured Replies

publicado

No soy muy diestro en VBA pero por lo que veo en tu código, estás utilizando la variable x pero no la has declarado ni inicializado en ninguna parte. Asegúrate de declarar e inicializar x antes de usarla. Por ejemplo, puedes agregar Dim x As Integer al principio de tu subrutina para declarar x como un entero, y luego agregar x = 0 antes de tu bucle For Each para inicializar x en 0.

Además, intenta agregar el espacio de nombres al objeto MSXML2.DOMDocument60 antes de intentar seleccionar los nodos.

Por ejemplo algo así:

Private documentoxml As MSXML2.DOMDocument60
Private listanodos As MSXML2.IXMLDOMNodeList
Private nodo As MSXML2.IXMLDOMNode

Sub cargar()
Dim x As Integer
x = 0
Set documentoxml = New MSXML2.DOMDocument60
documentoxml.setProperty "SelectionNamespaces", "xmlns:cfdi='http://Aqui va tu URL'"
documentoxml.Load (ActiveCell.Value)
Set listanodos = documentoxml.SelectNodes("/cfdi:Comprobante/cfdi:Conceptos/cfdi:Concepto")
For Each nodo In listanodos
With ActiveCell
	.Offset(x, 1).Range("C1").Value = nodo.Attributes.getNamedItem("Descripcion").Text
End With
x = x + 1
Next nodo
End Sub

Espero te ayude un poco la sugerencia. Saludines

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.