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.

Cambiar valor de variable en tiempo de ejecución

publicado

Buenas tardes amigos foristas pues me he atorado en un proyecto espero alguien me pueda orientar o soltar alguna opinion o sugerencia con lo siguiente: deseo cambiar el valor de una variable en tiempo de ejecucion el problema radica en que este valor puede venir de una bd access o de un archivo .ini y dicho valor contiene otras variables ejemplo

nota he utilizado callbyname para realizar el cambio de la variable

Public sVariable As String
Dim sNiño As String
Dim sPapa As String
'=====================
Private Sub Command1_Click()
Dim sT As String

sT = Variable
CallByName Me, "sVariable", VbLet, sT
MsgBox sVariable
End Sub
'====================
Private Sub CargaDatos()
Open "C:\prueba.txt" For Input As #1
Line Input #1, sVariable
Close #1
End Sub
'==================
Private Sub UserForm_Initialize()
sNiño = "o"
sPapa = "ron"
sVariable = "Manzana"
MsgBox sVariable
CargaDatos
End Sub
[/CODE]

el valor de la sVariable que contiene en este caso el archivo .ini

[CODE]"los papas del niñ" & sNiño& "Fue" & sPapa "Jose y Maria"
[/CODE]

el resultado que se espero es el siguiente

[b]Los papas del niño Fueron Jose y Maria[/b]

desgraciadamente el valor de sVariable me lo toma como string mostrandome los siguiente

[b]"los papas del niñ" & sNiño& "Fue" & sPapa "Jose y Maria"[/b]

en cambio hago el cambio en esta linea

[CODE] CallByName Me, "sVariable", VbLet, sT [/CODE]

por esta

[CODE] CallByName Me, "sVariable", VbLet,
"los papas del niñ" & sNiño& "Fue" & sPapa "Jose y Maria"
[/CODE]

funciona correctamente ....

:( espero alguien me pueda apoyar con alguna duda o sugerencia de antemano gracias y saludos desde Méxicoo_O

Featured Replies

No hay posts para mostrar

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.