sábado, 19 de setembro de 2020

PDFsam Basic an open source solution for manipulating pdfs files

pdfsam

Do you work with a lot of pdfs files, do you need to split, merge, extract pages, mix and rotates PDF files? PDFsam Basic is the solution, it is a free, open source, multi-platform software. It is user friendly and available for Mac Os, Linux and Windows for installation. And if your are not able to install software on your companies laptop, because of permissions, you can download the portable version for each of the platform.

pdfsam-merge


sexta-feira, 18 de setembro de 2020

Activate Developer Tab in Excel

Do you need to activate the The Developer tab? 

It  isn't displayed by default, but you can add it to the ribbon.

On the File tab, go to Options > Customize Ribbon.

Under Customize the Ribbon and under Main Tabs, select the Developer check box.


Website login using excel vba

Do you need to constantly login, introduce username and password into a website in order to check updated data? 

For example, if your are working with account receivables, do you need to check your company´s bank accounts to confirm if new deposits are available? And for that you have to input username and password manually every time you go to the bank website? Depending on the bank website, there is a timeout that is applied of 3 or 5 minutes and the website automatically logouts, so if you check the bank website 20 times, you have to input the username and password 20 times manually and it is prone to error. 

To avoid the manual input of the credentials and the potential typing error, you can use excel with vba macro to automate the login process and it is valid for all websites that requires username and password.

Will show an example of login to a account in the Facebook website using excel and vba macro. What the macro does it is to automate the login process: creates a Internet Explorer windows and fills the username and password fields and clicks the login button.

For that, on the Visual Basic window, you need to include some libraries, go to References and select  the following library: "Microsoft Internet Controls"




After including this reference create or copy this procedure on VBA and fill with your username and password.

Sub SearchBotLogin()
    
    'declare an Internet Explorer Object
    Dim objIE As InternetExplorer
    
    'create a new Internet Object
    Set objIE = New InternetExplorer
    
    'Set the Explorer to VIsible
    objIE.Visible = True
    
    'fill the Excel status bar with some progess information
    Application.StatusBar = "Login"
 
    'navigate IE to the web page
    objIE.navigate "https://www.facebook.com/"
 
    'wait here a few seconds while the browser is busy
    Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
 
    'fill the username in the username field id
    objIE.document.getElementById("email").Value = "username"
    
    'wait here a few seconds while the browser is busy
    Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop

    'fill the username in the password field id
    objIE.document.getElementById("pass").Value = "password"
    
    'wait here a few seconds while the browser is busy
    Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
     
    'click the 'Login' button
    objIE.document.getElementById("u_0_f").Click
    
    'wait again for the browser
    Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
     
    'fill the Excel status bar with some progress information
    Application.StatusBar = "Login OK"

End Sub
The elements for username, password and login button can be obtained using the inspection tool on the Internet Explorer


sexta-feira, 28 de março de 2014

IDEs for OpenErp Development

PyCharm IDE seems nice for Openerp development:

  • www.jetbrains.com/pycharm

Please feel free to suggest any other IDE.

sábado, 23 de julho de 2011

VB script to backup and send e-mail

Sometimes there is the need to send regularly to a specific e-mail address\person files with updated data. And most of the times it is done at the end of the day, when all the transaction of the day were recorded and ready to send. It can be quite boring if you do it every day, using for example outlook or the webmail, because the steps are always the same: creating the e-mail, adding the email address zipping the content, attaching the content, writing the subject and the body and sending the e-mail. And if you use webmail there are additional steps of logging on and the file uploading. So why not finding a solution that does this automatically with no human intervention.

And it is possible if we combine windows task manager, some vb script, 7z and a Gmail account. You can download the source code at sendMail. The zip file contains 3 files:
  1. sendMail.vbs - vb script
  2. 7z.exe - program to create the zip file
  3. logs.txt - log file to log the time and the events
Some configuration is needed:

homePath =  "C:\xxx\" 'folder where sendMail.vbs, logs.txt, 7z.exe and created zip files are
dataPath = "C:\xxxx\" ' folder that contains the files to zip
attachFile ="zipFile.ZIP"
'created zip file that will be attached to the e-mail

if zipFile("MAP*.?10") = 0 then ' file name of the file to zip or a wildcard containing the files to zip

For sending the e-mail, configure correctly the following parameters with your Gmail account details:

With objEmail
 .from = "xxx@gmail.com"
 .To = "xxx@gmail.com; xxx@yahoo.com.br" .Subject = "Test Mail" .Textbody = "The quick brown fox " & Chr(10) & "jumps over the lazy dog" 

  .Item (schema & "smtpserver") = "smtp.gmail.com"
  .Item (schema & "sendusername") = "xxx@gmail.com"
  .Item (schema & "smtpaccountname") = "xxx@gmail.com"
  .Item (schema & "sendpassword") ="xxxxxx"

You can test it double clicking on the sendMail.vbs file and checking thee events logged on the logs.txt.

Later I will be explaining how run this file regularly from windows task manager.

domingo, 21 de novembro de 2010

Applications can no longer be added as a custom tab in Facebook

Wondering why facebook disabled the following feature for applications:

"Due to changes in Facebook, you can no longer add Cities I've Visited (or any Facebook application) to a custom tab on your Facebook Profile page. Facebook phased out this feature and suggests that you access your favorite Facebook apps from the left hand navigation on your Facebook homepage." (source)

PDFsam Basic an open source solution for manipulating pdfs files

Do you work with a lot of pdfs files, do you need to split, merge, extract pages, mix and rotates PDF files?  PDFsam Basic is the solution,...