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.

Macro dependiendo del sistema operativo

publicado

cordial saludo

tengo el siguiente código para minimizar un formulario:

Option Explicit ' Declaración de variantes para los botones de maximizar y minimizar

'para OS 34 bits

'Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

'Private Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

'Private Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long

'Private Const WS_MINIMIZEBOX As Long = &H20000

'Private Const WS_MAXIMIZEBOX As Long = &H10000

'Private Const GWL_STYLE As Long = (-16)

'Private Const WS_SYSMENU As Long = &H80000 'variable para ocultar el botón x

' para OS 64 bits

Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long

Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long

Private Const WS_MINIMIZEBOX As Long = &H20000

Private Const WS_MAXIMIZEBOX As Long = &H10000

Private Const GWL_STYLE As Long = (-16)

Private Const WS_SYSMENU As Long = &H80000

lo que hago es que comento el código para la versión de windows que se tenga y así el formulario funcione, pero esta forma me parece muy manual; `por lo tanto solicito su ayuda para ver si se puede organizar el código para que con un condicional o un select case, excel sepa de cuantos bits es el OS y aplique el código sin tener que modificarlo manualmente.

Espero haberme echo entender. mil gracias

Featured Replies

publicado

Hola

Adapta lo siguiente:

Sub VersionSO_GP()

vso = Application.OperatingSystem

If VBA.InStr(1, vso, "32", vbTextCompare) Then
VBA.MsgBox "primer macro"
Else
VBA.MsgBox "segunda macro"
End If

End Sub
[/PHP]

En proximas consultas debes envolver los codigos/formulas con las etiquetas, tal como lo he hecho yo con mi ejemplo

Y nos comentas

Saludos

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.