desaparecer barra de titulo de excel

15/04/2005 - 20:09 por hector barajas | Informe spam
Quisiera ver si alguno de ustedes me puede decir como hacer mediante codigo
para desaparecer la barra de titúlo en la ventana de aplicación de excel.

Gracias de antemano por su ayuda

Preguntas similare

Leer las respuestas

#1 jose
15/04/2005 - 19:46 | Informe spam
no es posible, si es posible poner la ventana en pantalla completa para que
no se vea

Application.DisplayFullScreen = True

-
José Luis 22 ARG
-
Clickea en 'SI' en '¿Le ha ayudado esta exposición?' si esta exposición te
ha sido de ayuda.

"hector barajas" escribió:

Quisiera ver si alguno de ustedes me puede decir como hacer mediante codigo
para desaparecer la barra de titúlo en la ventana de aplicación de excel.

Gracias de antemano por su ayuda



Respuesta Responder a este mensaje
#2 KL
15/04/2005 - 20:49 | Informe spam
Hola Hector,

Esto no te elimina la barra de titulos, pero quita el texto de excel:

Application.Caption = ""
ActiveWorkbook.Windows(1).Caption = vbNullString

Y esto te ayudara a limpiar la barra del resto de cosas:

1) Para hacer desaparecer el icono de Excel situado en la barra de menus
podrias simplemente proteger el libro (por codigo o no):
Herramientas>Proteccion>Libro, marcando la opvion Ventanas.

2) Si quieres sustituir el icono que esta mas arriba (bara de herramientas
de la ventana) tendras que usar llamadas API. Aqui te pongo un ejemplo
(cuidado con las lineas de codigo que se pueden desconfigurar al
postearlas). Este codigo lo tienes que depositar en un modulo estandar de tu
proyecto VBA. Actualmente el procedimiento "ChangeIcon" cambia el icono
Excel por Notepad. Cambia notepad.exe por el archivo que contiene tu icono.

Saludos,
KL

'Inicio Codigo-
Declare Function GetActiveWindow32 Lib "USER32" _
Alias "GetActiveWindow" () As Integer

Declare Function GetFocus32 Lib "USER32" Alias _
"GetFocus" () As Long

Declare Function SendMessage32 Lib "USER32" _
Alias "SendMessageA" (ByVal hWnd As Long, _
ByVal wMsg As Long, ByVal wParam As Integer, _
ByVal lParam As Long) As Long

Declare Function ExtractIcon32 Lib "SHELL32.DLL" _
Alias "ExtractIconA" (ByVal hInst As Long, _
ByVal lpszExeFileName As String, _
ByVal nIconIndex As Long) As Long

Declare Function DestroyIcon32 Lib "USER32" _
Alias "DestroyIcon" (ByVal hIcon As Long) As Long

' API Constants
Const WM_SETICON = &H80
Const GWL_HINSTANCE = -6
Const GC_HICON = -14

Dim h32PreviousXLMAINBigIcon As Long
Dim h32PreviousXLMAINSmallIcon As Long
Dim h32PreviousEXCELBigIcon As Long
Dim h32PreviousEXCELSmallIcon As Long
Dim h32NewIcon As Long
Dim h32Icon As Long
Dim h32WndXLMAIN As Long
Dim h32WndEXCEL As Long

Sub ChangeIcon()
SaveExcelIcons
''Pass file containing the icon and icon's index
SetNewIcon "notepad.exe", 0
End Sub

Sub RestoreExcelIcons()
ChangeIcon32 h32PreviousXLMAINBigIcon, _
h32PreviousXLMAINSmallIcon, h32PreviousEXCELBigIcon, _
h32PreviousEXCELSmallIcon
DestroyIcon32 h32NewIcon
' Force menu bar (and icon) to redraw
ActiveMenuBar.Activate
End Sub

Sub SaveExcelIcons()
h32WndXLMAIN = GetActiveWindow32()
h32PreviousXLMAINBigIcon = SendMessage32(h32WndXLMAIN, _
WM_SETICON, True, 0)
h32PreviousXLMAINSmallIcon = SendMessage32(h32WndXLMAIN, _
WM_SETICON, False, 0)
h32WndEXCEL = GetFocus32()
h32PreviousEXCELBigIcon = SendMessage32(h32WndEXCEL, _
WM_SETICON, True, 0)
h32PreviousEXCELSmallIcon = SendMessage32(h32WndEXCEL, _
WM_SETICON, False, 0)
End Sub

Sub SetNewIcon(theIconSource As String, theIconIndex As Long)
' Get the icon from the source
h32NewIcon = ExtractIcon32(0, theIconSource, theIconIndex)
If CheckIcon(h32NewIcon) Then ChangeIcon32 h32NewIcon, _
h32NewIcon, h32NewIcon, h32NewIcon
' Force menu bar (and icon) to redraw
ActiveMenuBar.Activate
End Sub

Sub ChangeIcon32(h32XLMAINBigIcon As Long, h32XLMAINSmallIcon _
As Long, h32EXCELBigIcon As Long, h32EXCELSmallIcon As Long)
''Changes XL
h32WndXLMAIN = GetActiveWindow32()
h32Icon = SendMessage32(h32WndXLMAIN, WM_SETICON, True, _
h32XLMAINBigIcon)
h32Icon = SendMessage32(h32WndXLMAIN, WM_SETICON, False, _
h32XLMAINSmallIcon)
'Change worksheet
h32WndEXCEL = GetFocus32()
h32Icon = SendMessage32(h32WndEXCEL, WM_SETICON, True, _
h32EXCELBigIcon)
h32Icon = SendMessage32(h32WndEXCEL, WM_SETICON, False, _
h32EXCELSmallIcon)
End Sub

Function CheckIcon(hIcon As Variant) As Boolean
Select Case hIcon
Case 1: MsgBox "Source file has no icons"
Case 0: MsgBox "Icon index isn't valid"
Case Else: CheckIcon = True
End Select
End Function
'Fin Codigo-
Respuesta Responder a este mensaje
#3 hector barajas
16/04/2005 - 01:04 | Informe spam
Les agradezco a ambos sus respuestas bastante claras y utiles.

"KL" escribió en el mensaje
news:
Hola Hector,

Esto no te elimina la barra de titulos, pero quita el texto de excel:

Application.Caption = ""
ActiveWorkbook.Windows(1).Caption = vbNullString

Y esto te ayudara a limpiar la barra del resto de cosas:

1) Para hacer desaparecer el icono de Excel situado en la barra de menus
podrias simplemente proteger el libro (por codigo o no):
Herramientas>Proteccion>Libro, marcando la opvion Ventanas.

2) Si quieres sustituir el icono que esta mas arriba (bara de herramientas
de la ventana) tendras que usar llamadas API. Aqui te pongo un ejemplo
(cuidado con las lineas de codigo que se pueden desconfigurar al
postearlas). Este codigo lo tienes que depositar en un modulo estandar de


tu
proyecto VBA. Actualmente el procedimiento "ChangeIcon" cambia el icono
Excel por Notepad. Cambia notepad.exe por el archivo que contiene tu


icono.

Saludos,
KL

'Inicio Codigo-
Declare Function GetActiveWindow32 Lib "USER32" _
Alias "GetActiveWindow" () As Integer

Declare Function GetFocus32 Lib "USER32" Alias _
"GetFocus" () As Long

Declare Function SendMessage32 Lib "USER32" _
Alias "SendMessageA" (ByVal hWnd As Long, _
ByVal wMsg As Long, ByVal wParam As Integer, _
ByVal lParam As Long) As Long

Declare Function ExtractIcon32 Lib "SHELL32.DLL" _
Alias "ExtractIconA" (ByVal hInst As Long, _
ByVal lpszExeFileName As String, _
ByVal nIconIndex As Long) As Long

Declare Function DestroyIcon32 Lib "USER32" _
Alias "DestroyIcon" (ByVal hIcon As Long) As Long

' API Constants
Const WM_SETICON = &H80
Const GWL_HINSTANCE = -6
Const GC_HICON = -14

Dim h32PreviousXLMAINBigIcon As Long
Dim h32PreviousXLMAINSmallIcon As Long
Dim h32PreviousEXCELBigIcon As Long
Dim h32PreviousEXCELSmallIcon As Long
Dim h32NewIcon As Long
Dim h32Icon As Long
Dim h32WndXLMAIN As Long
Dim h32WndEXCEL As Long

Sub ChangeIcon()
SaveExcelIcons
''Pass file containing the icon and icon's index
SetNewIcon "notepad.exe", 0
End Sub

Sub RestoreExcelIcons()
ChangeIcon32 h32PreviousXLMAINBigIcon, _
h32PreviousXLMAINSmallIcon, h32PreviousEXCELBigIcon, _
h32PreviousEXCELSmallIcon
DestroyIcon32 h32NewIcon
' Force menu bar (and icon) to redraw
ActiveMenuBar.Activate
End Sub

Sub SaveExcelIcons()
h32WndXLMAIN = GetActiveWindow32()
h32PreviousXLMAINBigIcon = SendMessage32(h32WndXLMAIN, _
WM_SETICON, True, 0)
h32PreviousXLMAINSmallIcon = SendMessage32(h32WndXLMAIN, _
WM_SETICON, False, 0)
h32WndEXCEL = GetFocus32()
h32PreviousEXCELBigIcon = SendMessage32(h32WndEXCEL, _
WM_SETICON, True, 0)
h32PreviousEXCELSmallIcon = SendMessage32(h32WndEXCEL, _
WM_SETICON, False, 0)
End Sub

Sub SetNewIcon(theIconSource As String, theIconIndex As Long)
' Get the icon from the source
h32NewIcon = ExtractIcon32(0, theIconSource, theIconIndex)
If CheckIcon(h32NewIcon) Then ChangeIcon32 h32NewIcon, _
h32NewIcon, h32NewIcon, h32NewIcon
' Force menu bar (and icon) to redraw
ActiveMenuBar.Activate
End Sub

Sub ChangeIcon32(h32XLMAINBigIcon As Long, h32XLMAINSmallIcon _
As Long, h32EXCELBigIcon As Long, h32EXCELSmallIcon As Long)
''Changes XL
h32WndXLMAIN = GetActiveWindow32()
h32Icon = SendMessage32(h32WndXLMAIN, WM_SETICON, True, _
h32XLMAINBigIcon)
h32Icon = SendMessage32(h32WndXLMAIN, WM_SETICON, False, _
h32XLMAINSmallIcon)
'Change worksheet
h32WndEXCEL = GetFocus32()
h32Icon = SendMessage32(h32WndEXCEL, WM_SETICON, True, _
h32EXCELBigIcon)
h32Icon = SendMessage32(h32WndEXCEL, WM_SETICON, False, _
h32EXCELSmallIcon)
End Sub

Function CheckIcon(hIcon As Variant) As Boolean
Select Case hIcon
Case 1: MsgBox "Source file has no icons"
Case 0: MsgBox "Icon index isn't valid"
Case Else: CheckIcon = True
End Select
End Function
'Fin Codigo-


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida