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


PyCharm: Your Python BFF

Ever felt like you're drowning in a sea of Python code? Fear not, my friend, for PyCharm is here to save the day! It's like having a...