You are on page 1of 3

Modules> funciones Sel carpeta

Rem Attribute VBA_ModuleType=VBAModule


Option VBASupport 1
Function selcarpeta(que As String) As String
Dim carpeta As String
Do Until carpeta <> "/home/beto/Documents"
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Please, select " & que & " folder."
.ButtonName = "Select"
.AllowMultiSelect = False
If .Show = 0 Then Exit Function
carpeta = .SelectedItems(1)
End With
If carpeta = "" Then
MsgBox "You did not select a folder"
End If
Loop
selcarpeta = carpeta
End Function

Modules > Procedimientos

Rem Attribute VBA_ModuleType=VBAModule


Option VBASupport 1
Sub origen()
Dim NoC As String
NoC = selcarpeta("Source")
If NoC <> "/home/beto/Documents" Then Range("F8").Value = NoC
End Sub
Sub destino()
Dim NoC As String
NoC = selcarpeta("/home/beto/Documents/new")
If NoC <> "" Then Range("F15").Value = NoC
End Sub
Sub comienzo()
Application.ScreenUpdating = False
If Range("F8").Value = "" Then
MsgBox ("Please select Source Folder")
Exit Sub
End If
If Range("F15").Value = "" Then
MsgBox ("Please select Destination Folder")
Exit Sub
End If
PDF.Show
Application.ScreenUpdating = True
End Sub

ORIGEN-destino comienzo
Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Sub origen()
Dim NoC As String
NoC = selcarpeta("Source")
If NoC <> "/home/beto/Documents" Then Range("F8").Value = NoC
End Sub
Sub destino()
Dim NoC As String
NoC = selcarpeta("/home/beto/Documents/new")
If NoC <> "" Then Range("F15").Value = NoC
End Sub
Sub comienzo()
Application.ScreenUpdating = False
If Range("F8").Value = "" Then
MsgBox ("Please select Source Folder")
Exit Sub
End If
If Range("F15").Value = "" Then
MsgBox ("Please select Destination Folder")
Exit Sub
End If
PDF.Show
Application.ScreenUpdating = True
End Sub

Module > title bar > remove/caption

Rem Attribute VBA_ModuleType=VBAModule


Option VBASupport 1
Option Explicit

Private Declare Function FindWindow Lib "User32" _


Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "User32" _


Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) 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 DrawMenuBar Lib "User32" ( _


ByVal hwnd As Long) As Long
Public Declare Function sndPlaySound32 _
Lib "winmm.dll" _
Alias "sndPlaySoundA" ( _
ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Sub RemoveCaption(objForm As Object)


Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long
If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption) 'XL2000+
End If
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000
SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm
End Sub

Class modulea >


Calendar FRM
PDF

You might also like