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

  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,




Excel 2013 - Especificações e Limitações - Specifications and Limitations


Não existe nada melhor do que conhecer o ambiente onde trabalhamos ou desenvolvemos. Precisamos compreender as exatas especificações e limitações.

Sim, volto a deixar no original, para que nada possa perder-se por causa da tradução.


Worksheet and workbook specifications and limitsMAXIMUM LIMIT
Maximum limits of memory storage and file size for Data Model workbooks Depends on System, please refer MSDN
Open workbooksLimited by available memory and system resources
Sheets in a workbookLimited by available memory
Names in a workbookLimited by available memory
Windows in a workbookLimited by available memory
Linked sheetsLimited by available memory
ScenariosLimited by available memory; a summary report shows only the first 251 scenarios
Custom functionsLimited by available memory
ReportsLimited by available memory
Named views in a workbookLimited by available memory
Worksheet size1,048,576 rows by 16,384 columns
Column width255 characters
Row height409 points
Page breaks1,026 horizontal and vertical
Total number of characters that a cell can contain32,767 characters
Characters in a header or footer255
Colors in a workbook16 million colors (32 bit with full access to 24 bit color spectrum)
Unique cell formats/cell styles64,000
Fill styles256
Line weight and styles256
Unique font types1,024 global fonts available for use; 512 per workbook
Number formats in a workbookBetween 200 and 250, depending on the language version of Excel that you have installed
Hyperlinks in a worksheet66,530 hyperlinks
Panes in a window4
Changing cells in a scenario32
Adjustable cells in Solver200
Zoom range10 percent to 400 percent
Sort references64 in a single sort; unlimited when using sequential sorts
Undo levels100
Fields in a data form32
Workbook parameters255 parameters per workbook
Items displayed in filter drop-down lists10,000
Noncontiguous cells that can be selected2,147,483,648 cells
Calculation specifications and limitsMAXIMUM LIMIT
Worksheet arraysLimited by available memory
Cross-worksheet array formula dependencyLimited by available memory
Area dependencyLimited by available memory
Area dependency per worksheetLimited by available memory
Number precision15 digits
Smallest allowed negative number-2.23E-308
Smallest allowed positive number2.23E-308
Largest allowed positive number1.00E+308
Largest allowed negative number-1.00E+308
Largest allowed positive number via formula1.7976931348623158e+308
Largest allowed negative number via formula-1.7976931348623158e+308
Length of formula contents8,192 characters
Internal length of formula16,384 bytes
Iterations32,767
Selected ranges2,048
Arguments in a function255
Nested levels of functions64
User defined function categories255
Number of available worksheet functions341
Size of the operand stack1,024
Cross-worksheet dependency64,000 worksheets that can refer to other sheets
Dependency on a single cell4 billion formulas that can depend on a single cell
Linked cell content length from closed workbooks32,767
Earliest date allowed for calculationJanuary 1, 1900 (January 1, 1904, if 1904 date system is used)
Latest date allowed for calculation31-Dec-99
Largest amount of time that can be entered9999:59:59
Charting specifications and limitsMAXIMUM LIMIT
Charts linked to a worksheetLimited by available memory
Data points in a data series for 2-D chartsLimited by available memory
Data points in a data series for 3-D chartsLimited by available memory
Data points for all data series in one chartLimited by available memory
Worksheets referred to by a chart255
Data series in one chart255
PivotTable and PivotChart report specifications and limitsMAXIMUM LIMIT
PivotTable reports on a sheetLimited by available memory
Row or column fields in a PivotTable reportLimited by available memory
Calculated item formulas in a PivotTable reportLimited by available memory
Calculated item formulas in a PivotChart reportLimited by available memory
Unique items per field1,048,576
Report filters in a PivotTable report256 (may be limited by available memory)
Value fields in a PivotTable report256
Report filters in a PivotChart report256 (may be limited by available memory)
Value fields in a PivotChart report256
Length of the MDX name for a PivotTable item32,767
Length for a relational PivotTable string32,767
Items displayed in filter drop-down lists10,000
Shared workbook specifications and limitsMAXIMUM LIMIT
Personal views in a shared workbookLimited by available memory
Workbooks that can be merged at one timeLimited by available memory
Users who can open and share a shared workbook at the same time256
Days that change history is maintained32,767 (default is 30 days)
Cells that can be highlighted in a shared workbook32,767
Colors used to identify changes made by different users when change highlighting is turned on32 (each user is identified by a separate color; changes made by the current user are highlighted with navy blue)
Excel tables in a shared workbook0 (zero)

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


TagsExcel 2013, Specifications, Limitations, especificações, limitações,


diHITT - Notícias