Views

Important:

Quaisquer necessidades de soluções e/ou desenvolvimento de aplicações pessoais/profissionais, que não constem neste Blog podem ser tratados como consultoria freelance à parte.

...

29 de outubro de 2013

VBA Tips - GetComputerName - API - Obtendo o nome do Computador através de API

Retorne o nome do computador usando uma API.


Private Declare Function GetComputerName Lib "kernel32" Alias _
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long






Deixe os seus comentários! Envie este artigo, divulgue este link na sua rede social...


Tags: VBA, Tips, 
API, kernel32.dll, Get, computer, name, 



VBA Tips - GetUserName - API - Obtendo o nome do Usuário com API

Retorne o nome do usuário usando uma API.


Private Declare Function GetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long






Deixe os seus comentários! Envie este artigo, divulgue este link na sua rede social...


Tags: VBA, Tips, 
GetUserName, API, nome, usuário, user, name, username, advapi32.dll, 



VBA Tips - SendLotusEmails - Envie e-mail com o Lotus Notes

Envie e-mails através do Lotus Notes. Requer as Classes de Automação do Lotus (Lotus Automation Classes - notes32.tlb).

   ' Attribute VB_Name = "modLotus"    ' This public sub will send a mail and attachment if neccessary to the recipient including the body text.  ' Requires that notes client is installed on the system.    Public Sub SendLotusEMail(Subject As String, Attachment As String, recipient As String, bodytext As String, saveit As Boolean)        ' Set up the objects required for Automation into lotus notes            Dim MailDB As Object ' The mail database            Dim UserName As String ' The current users notes name            Dim MailDBName As String ' THe current users notes mail database name            Dim MailDoc As Object ' The mail document itself            Dim AttachME As Object ' The attachment richtextfile object            Dim LotusSession As Object ' The notes session            Dim EmbedObj As Object ' The embedded object (Attachment)            ' Start a session to notes            Set LotusSession = CreateObject("Notes.NotesSession")            ' Get the sessions username and then calculate the mail file name            ' You may or may not need this as for MailDBname with some systems you            ' can pass an empty string            UserName = LotusSession.UserName            MailDBName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"            ' Open the mail database in notes            Set MailDB = LotusSession.GetDatabase("", MailDBName)              If MailDB.isOpen = True Then                        ' Already open for mail              Else                      MailDB.OPENMAIL              End If            ' Set up the new mail document            Set MailDoc = MailDB.CreateDocument            MailDoc.Form = "Memo"            MailDoc.sendto = recipient            MailDoc.Subject = Subject            MailDoc.body = bodytext            MailDoc.SaveMessageOnSend = saveit            ' Set up the embedded object and attachment and attach it            If Attachment <> "" Then                    Set AttachME = MailDoc.CreateRichTextItem("Attachment")                    Set EmbedObj = AttachME.EmbedObject(1454, "", Attachment, "Attachment")                    MailDoc.CreateRichTextItem ("Attachment")            End If            ' Send the document            MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder            MailDoc.Send 0, recipient                  ' Clean Up            Set MailDB = Nothing            Set MailDoc = Nothing            Set AttachME = Nothing            Set LotusSession = Nothing            Set EmbedObj = Nothing    End Sub

Deixe os seus comentários! Envie este artigo, divulgue este link na sua rede social...


Tags: VBA, Lotus, Lotus Notes, e-mails, notes32.tlb, send,



VBA Tips - Launch IE - Carregando o Internet Explorer com uma página




Abra uma nova janela com o Internet Explorer e opcionalmente carregue um endereço.
  Sub LaunchIE()
    Dim objIE As InternetExplorer            Set objIE = New InternetExplorer            objIE.Visible = True            objIE.Navigate "http://inanyplace.blogspot.com"            Do            Loop Until objIE.ReadyState = READYSTATE_COMPLETE            objIE.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER    End Sub
Deixe os seus comentários! Envie este artigo, divulgue este link na sua rede social...


Tags: VBA, Tips, Internet, IE Explorer, Microsoft,



VBA Tips - GetComputerName - Sabendo o nome do computador




Tenha acesso ao nome do computador em uso. Essa funcionalidade pode habilitar a sua aplicação para uma conexão automática.
  Private Declare Function GetComputerName Lib "kernel32" Alias _      "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Deixe os seus comentários! Envie este artigo, divulgue este link na sua rede social...


Tags: VBA, Tips, API, DLL, kernel32.dll, GetComputerName, Get, Computer, Name, 



VBA Tips - GetUser - Saiba o nome do usuários do Windows



Saiba o nome do usuário que está usando a sua aplicação.

Podemos usar essa funcionalidade para uma conexão automática, ou solicitação de identificação para acesso. Inclui API.
  Private Declare Function GetUserName Lib "advapi32.dll" Alias _      "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long        Function GetUser() As String              Dim UserName As String ' receives name of the user                Dim slength As Long ' length of the string            Dim RetVal As Long ' return value              UserName = Space(255) ' room for 255 characters              slength = 255 ' initialize the size of the string              RetVal = GetUserName(UserName, slength) ' slength is now the length of the returned string              UserName = Left(UserName, slength - 1) ' extract the returned info from the buffer                User = UserName            End Function

Deixe os seus comentários! Envie este artigo, divulgue este link na sua rede social...


Tags: VBA, API, DLL, api32.dll,



21 de outubro de 2013

Excel Basic - Teclas de Atalho - Shortcut Keys



Sim, combinar teclas pode acelerar muito o nosso trabalho no dia-a-dia, para isso precisamos conhecer algumas combinações. Só terá o trabalho para traduzir. Mas não chore o mais difícil já fiz prá vocês, que foi reuní-las numa lista:


Teclas de CombinaçãoO que fazem
Combinação das Teclas de Atalho do MS Excel para tarefas simples
ALT+TAB Switch to the next window
ALT+SHIFT+TABSwitch to the previous window
ALT+F5Restore the size of the active window after you maximize it
CTRL+W or CTRL+F4 Close the active window
F6Move to a task pane from another pane in the program window (clockwise direction)
SHIFT+F6 Move to a task pane from another pane in the program window  (counterclockwise direction)
Ctrl + F6 Switch between open workbooks or windows
CTRL+SHIFT+F6Switch to the previous window
Ctrl + F9Minimize current window
Ctrl + F10 Maximize currently selected window
PRINT SCREENCopy a picture of the screen to the Clipboard
ALT+PRINT SCREEN Copy a picture of the selected window to the Clipboard
Ctrl + TabMove between Two or more open Excel files
Ctrl+F4 Close the selected workbook window
Ctrl+nCreate a new blank workbook (Excel File)
Ctrl+F7 Move Workbook Windows which are not maximized
Alt+F4Close Excel
Excel Shortcut Keys for Working with Ribbon
Ctrl+F1Minimize or restore the Ribbon
Alt/F10 Select the active tab of the Ribbon and activate the access keys. Press either of these keys again to move back to the document and cancel the access keys. and thenarrow left or arrow right
Shift+F10 Display the shortcut menu for the selected command
Space/EnterActivate the selected command or control in the Ribbon, Open the selected menu or gallery in the Ribbon
EnterFinish modifying a value in a control in the Ribbon, and move focus back to the document
F1Get help on the selected command or control in the Ribbon
Excel Shortcut Keys for Working with Dialogs
Shift + F3Open the Excel formula window
Shift + F5 Bring up search box
CTRL+fDisplay the Find and Replace dialog box (with Find Tab selected)
CTRL+h Display the Find and Replace dialog box (with Replace Tab selected)
CTRL +g (or F5)Display the 'Go To' dialog box
Alt+' Display the Style dialog box
Alt+SpaceDisplay the Control menu for Main Excel window
Ctrl+o Open File
Ctrl+sSave the active file with its current file name, location, and file format
F12 Display the Save As dialog box
f10 (or alt)Turn key tips on or off
Ctrl+p Print File (Opens print menu)
F1Display the Excel Help task pane
F7 Display the Spelling dialog box
Shift+F7Display the Thesaurus dialog box
Alt+F8 Display the Macro dialog box
Alt+F11Open the Visual Basic Editor to create Macros
F11 Create chart
Excel Shortcut Keys for Working with Worksheets
Shift + F11Insert New Worksheet
Ctrl + Page up Move between Excel work sheets in the same Excel document
Ctrl + Page downMove between Excel work sheets in the same Excel document
Page DownMove one screen Down in a worksheet
Page Up Move one screen Up in a worksheet
Alt+Page UpMove one screen to the Left
Alt+Page Down Move one screen to the Right
F7Spell check selected text or document
F11 Create chart
Excel Shortcut Keys for Working with Cells
Combinações Simples
Ctrl + A Select all contents of the worksheet
Ctrl + BBold highlighted selection
Ctrl + I Italic highlighted selection
Ctrl + KInsert link
Ctrl + U Underline highlighted selection
Ctrl + 5Strikethrough highlighted selection
Ctrl + P Bring up the print dialog box to begin printing
Ctrl + ZUndo last action
Ctrl + Y Redo last action
Digitação de Dados
F2Edit the selected cell
Ctrl + Shift + ; Enter the current time
Ctrl + ;Enter the current date
Alt + = Create a formula to sum all of the above cells
Ctrl + 'Insert the value of the above cell into cell currently selected
Select & Move in the sheet
F5Go to a specific cell. For example, C6
Alt+Arrow Down Display the AutoComplete list
Shift + SpaceSelect entire row
Ctrl + Space Select entire column
Ctrl+Shift+oSelect all cells with comments
Shift+Arrow Keys Extend the selection by one cell
Ctrl+Shift+Arrow KeyExtend the selection to the last cell with content in row or column
Shift+Page Down/Shift+Page Up Extend the selection down one screen /up one screen
Shift+HomeExtend the selection to the beginning of the row
Ctrl+Shift+Home Extend the selection to the beginning of the worksheet
Ctrl+Shift+EndExtend the selection to the last used cell on the worksheet (lower-right corner)
Arrow Keys Move one cell up, down, left, or right in a worksheet
HomeMove to the beginning of a row in a worksheet
Ctrl+Home Move to the beginning of a worksheet
Ctrl+EndMove to the last cell with content on a worksheet
Ctrl+ Arrow key Move to next section of text
Ações dentro da célula
Ctrl+Arrow Lef t/ Ctrl+Arrow RightMove one word to the left / to the right
Home / EndMove to the beginning / to the end of a cell entry
Alt+Enter Start a new line in the same cell
EnterComplete a cell entry and move down in the selection
Shift+Enter Complete a cell entry and move up in the selection
EscCancel a cell entry
Backspace Delete the character to the left of the insertion point, or delete the selection
DeleteDelete the character to the right of the insertion point, or delete the selection
Ctrl+DeleteDelete text to the end of the line
Formatando
Ctrl +1Format cells dialog
Ctrl + Shift + ! Format number in comma format
Ctrl + Shift + $Format number in currency format
Ctrl + Shift + # Format number in date format
Ctrl + Shift + %Format number in percentage format
Ctrl + Shift + ^ Format number in scientific format
Ctrl + Shift + @Format number in time format
Ctrl+Shift+~ Apply the General number format
F4Repeat last formatting action/Apply previously applied Cell Formatting to a different Cell
Ativando a edição ou Selecionando as células
Ctrl+d Fill complete cell down (Copy above cell)
Ctrl+rFill complete cell to the right (Copy cell from the left)
Ctrl+" Fill cell values down and edit (Copy above cell values)
Ctrl+' (apostrophe)Fill cell formulas down and edit (Copy above cell formulas)
Ctrl+l Insert a table (display Create Table dialog box)
Ctrl+-Delete Cell/Row/Column Menu
Ctrl+Shift++ Insert Cell/Row/Column Menu
Ctrl+- with row /
column selected
Delete row / delete column
Ctrl+Shift++ with row /
column selected
Insert row/ insert column.
Shift+F2Insert / Edit a cell comment
Shift+f10, then m Delete comment.
Alt+F1Create and insert chart with data in current range as embedded Chart Object
F11 Create and insert chart with data in current range in a separate Chart sheet
Ctrl+kInsert a hyperlink
Enter (in a cell with a hyperlink)Activate a hyperlink
Mostrando e escondendo elementos
Ctrl+9 Hide the selected rows
Ctrl+Shift+9Unhide any hidden rows within the selection
Ctrl+0 (zero) Hide the selected columns
Ctrl+Shift+0 (zero)Unhide any hidden columns within the selection
Ctrl+ ~ Alternate between displaying cell values and displaying cell formulas
Alt+Shift+Arrow RightGroup rows or columns
Alt+Shift+Arrow Left Ungroup rows or columns
Ctrl+6Alternate between hiding and displaying objects
Ctrl+8 Display or hides the outline symbols
Ctrl+6Alternate between hiding objects, displaying objects, and displaying placeholders for objects
Fórmulas e Nomes
=Start a formula
Alt+= Insert the AutoSum formula
Shift+F3Display the Insert Function dialog box
Ctrl+a Display Formula Window after typing formula name
Ctrl+Shift+aInsert Arguments in formula after typing formula name
Shift+F3 Insert a function into a formula
Ctrl+Shift+EnterEnter a formula as an array formula
F4 After typing cell reference (e.g. =A5) makes reference absolute (=$A$5)
F9Calculate all worksheets in all open workbooks
Shift+F9 Calculate the active worksheet
Ctrl+Alt+F9Calculate all worksheets in all open workbooks, regardless of whether they have changed since the last calculation
Ctrl+Alt+Shift+F9Recheck dependent formulas, and then calculates all cells in all open workbooks, including cells not marked as needing to be calculated
Ctrl+Shift+uToggle expand or collapse formula bar

Deixe os seus comentários! Envie este artigo, divulgue este link na sua rede social...


TagsVBA, Excel, 
Merge, UnMerge, Cells, células, mesclar, 


eBooks VBA na AMAZOM.com.br

Vitrine