Posts

Showing posts from December, 2016

Run-time error '1004' Method 'Rows' of Object_Global failed

Hey ! I am writing VBA code for finding last_row of next sheet inside a chart sheet, in chart I a using Chart_MouseUp and Chart_MouseDown function here I am explaining Chart_MouseUp  inside  Chart_MouseDown event I am taking I am taking chart start point x and y co-ordinate and and on Chart_MouseUp  event I am taking chart end point x and y co-ordinate and after this process I am storing start point and end end point x co-ordinate inside next sheet "AQ" column for this purpose I have to know number of cell which is blanked inside AQ column for this I have to know last_Row of AQ cell and for this purpose I am using this code                    Dim last_Row As Integer                   last_Row = Sheets(5).Range("B" & Rows.count).End(xlUp).Row                   MsgBox last_Row  Run-time error '1004'  Method 'Rows'  of Object_Global failed Whenever code like 'Sheets(5).Range("AQ4") = startX 'Sheets(5).Range("AQ5&q

Interactive Chart Shows Start point and End Point Using MouseDown and MouseUp Event in Vba

Image
Hi Friends !  Today I will discussed how to select specified location inside a chart using Vba I am facing this problem from 2-3 days but now I got exact solution to Operate such type of Problem. To explain this scenario I took some data that by which I could create a chart and so I generate a  Sheet which contains some data  Now, I select data containing columns and press F11 and then it automatically generate a chart sheet like this Now I will go to developer tab and click on chart as circled portion shown below  inside image and then a window will be opened  Inside  that window paste the given code like this Code Dim startX As String Dim startY As Double Dim endX As String Dim endY As Double Private Sub Chart_MouseDown(ByVal Button As Long, ByVal Shift As Long, _         ByVal x As Long, ByVal y As Long)     Dim ElementID As Long, Arg1 As Long, Arg2 As Long     Dim myX As Variant, myY As Double       With ActiveChart         

Run time error 1004 during importing .bas file using VBA code

Image
Hi I am facing a problem during importing a .bas file inside my excel file using Vba code this is my code Sub importModuleBas() Dim wb As Workbook Dim strTemp As String sPath = "D:\Users\dheeraj.kumar\Desktop\New folder\" sourseFile = sPath & "Projec.xlsm" strTemp = sPath & "TransModule.bas" Set wb = Workbooks.Open(sourseFile ) wb.Activate wb.VBProject.VBComponents.Import (strTemp) 'Kill (strTemp) wb.Close End Sub During this I am Obtaining run time 1004 error if you have any idea then please help me Note :Basically I want to export a module from workbook to another workbook using VBA  Note : this error is also known as  Programmatic access to Visual Basic Project is not trusted during importing .bas file from specified location Hey I got solution of this question there is not any problem inside code but also before operating such type of Operation we have to follow some setting steps inside Excel Sett

Google Home

Image
Now a Days technology is growing with a fast rate. In this trade Google is largest company of the world. Not only Google is doing something great for changing the world new a way  but also there are a lot of companies but in these companies race Google moves with a fast rate. In previous Month Google I/O had announced Google Home a Bluetooth Wi-Fi Speaker and works as a smart home control which can be control by your commands. Introduction Previous Year Amazon developed an artificial intelligence Bluetooth speaker Amazon Echo called  Alexa and it similar to Apple’s siri assistant. Alexa is a speaker and personal assistant also. In market demand of Alexa was so much that Amazon launched it’s three versions back to back. Now it’s turn to Google and Google I/O in previous month on 4 November 2016 announced it’s first smart AI speaker called Google Home.              What is Google Home? Google Home is a Wi-Fi speaker that also works as a smart home control center and wor

Download data from mysql db to csv file using java

Image
Hi Friends ! In Previous blog We discussed Extract data from mysql db to Csv file using Java and inside We provide a path where file is stored but in real scenario it is not possible that we create an application and instruct to user that brother when you use this application then for run it properly you have to make a folder at specific location where your obtained data from database and that data will be  stored in it and you can reuse this data where you want. In previous scenario we can say that we have discussed that how we obtain our data from database and store it inside CSV for further use. In this Blog I will discussed that how you can obtain data from data base and stored it inside CSV file and that after download CSV file . In this case also we create three files for completing this Scenario 1.exportCsv.html : which perform a form action and contains a button and after submit button our Java Servlet will be called. 2.ExportData.java :It is a Servlet class and i

Export data from mysql db to csv file using java

Image
Hi friends ! Today I am discussing about simple but very important scenario. When we create any application then during creation of application we have face many scenarios like 1.Taking information from user and storing these information inside database : Generally such type of Operation is performed by user using form application 2.Taking Data from Database and Displaying on Page : We can perform such type of Operation in various ways like using JSP,JSTL tags or you can perform such operations using JQUERY also. 3.Taking Data from Database and download it in Excel or CSV format : In this we want our data from database and store it inside Excel or text files for further use. And we have chosen third scenario from discussion for performing this Operation we have to need three files exportCsv.html  :- this contains a button for clicking and performing exporting data from database Operation ExportData.java  :- It is a servlet class which defines connectivity from databas

Type Casting in Java

Image
Type conversion or type casting simply means different ways of changing an entity of one data type into another data type. e.g. simply conversion of integer value into floating value or text. Java supports two types of casting :     1.)   Primitive data type casting 2.)   Reference data type casting Note : we will discussed Reference data type casting in next discussion. Primitive data type casting : Primitive data types are basic data types of any programming language we can also say that these are  building blocks of any programming language. In Java Primitive data types are classified into eight different types : 1.  Boolean Data type : which contains its value either true or false. 2    2.    Char : character data type whose values are 16 bit Unicode character       3.   Arithmetic Data type : which also categorized into two different ways : Integral   types : Byte Int  Long Short Floating–point types Float Double Primitiv

Remove Duplicates Rows completely from sheet

Image
Hey How are You friends ? I know you are fine but I am in a big Problem and I know you will help me after solving my problem. Today I got a task  for removing duplicate rows from sheet, and my guide provided me two scenarios. First scenarios is not so hard and it is easily done by me but second scenarios is not we could not say it is so hard although I have solve this Problem also but  the way from which I have solve this problem is not satisfactory for me hence please give me some sun shine to come out from this darkness. I am discussing both scenarios here and please provide suitable answer for doing this task. Note : Value of all column approximately remains same but First Scenario : Contains Parameter that decide Duplicates In this case first column of sheet contains duplicate values as shown in figure below so, it easy to remove all those rows by using RemoveDuplicates function  In this figure Date is parameter by which we decide row is repeated or not, if it is rep