Jump to content

Read Data from Excel and fill that data into other field.


Recommended Posts

This is my sample code to copy the data from excel and paste it into mouse coordinate 

#include<Excel.au3>


Local $oExcel_1= _Excel_Open()
Local $sWorkbook="C:\Users\Tushar Verma\Desktop\AUTO IT\Test.xlsx"
Local $oWorkbook = _Excel_BookOpen($oExcel_1,$sWorkbook)

WinActivate($oWorkbook)

Local $read1=_Excel_RangeRead($oWorkbook,Default,"B1")

;Now paste that into some mouse coordinates. How I do it?

 

Link to comment
Share on other sites

We do not know which application you want to paste the data to. So I suggest to use _Excel_RangeCopyPast to copy the Excel data to the clipboard and then send the keys to the selected applications to paste the date (like ctrl+v)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I see that you are new here. But you have to show some effort yourself. We do not spoon feed code to users.

First step: Add _Excel_RangeCopyPaste to your script
Second Step: Post your script so we can check the code
Third step: Tell us which application you need to paste the data to. If there are multiple applications then please tell us which application you use most.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Developers
1 hour ago, Tushar said:

is there anyone who solve this query ?

Also please be a little patient and do not bump your post within 24 hours unless you have payed for your 1 hour SLA service contract. ;) 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@water 

Sorry for this...I m using outlook application to paste my data.

My code is this...

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>

#include<Excel.au3>


Example()

HotKeySet("+!d", "Terminate");  shift-alt-d

Func Example()

Local $oExcel_1= _Excel_Open()
Local $sWorkbook="C:\Users\Tushar Verma\Desktop\AUTO IT\Test.xlsx"
Local $oWorkbook = _Excel_BookOpen($oExcel_1,$sWorkbook)

WinActivate($oWorkbook)
Sleep(3000)
$read1=_Excel_RangeCopyPaste($oWorkbook,Default,"B1:B3")
MsgBox(0,"Read",$read1)

   Local $iPID = Run("C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE");
   Sleep(10000);

   MouseClick("left",944,89);

   Sleep(10000);


   MouseClick("left",241,208);
   Sleep(5000);

   MouseClick("left",1148,647,12);
   Sleep(5000);
   MouseClick("left",739,357);
   Sleep(5000);
   MouseClick("left",744,429);
   Sleep(5000);

   ControlFocus("Choose File to Upload","","Edit1");
   ControlSetText("Choose File to Upload","","Edit1","C:\Users\Tushar Verma\Desktop\Add-in File\Pinnable_CRM");
   ControlClick("Choose File to Upload","","Button1");
   Sleep(5000);
   MouseClick("left",638,294);
   Sleep(8000);

   MouseClick("left",1133,71);
   Sleep(5000);
   MouseClick("left",370,686);
   Sleep(10000);
   MouseClick("left",1078,90);
   Sleep(10000);
    MouseClick("left",1097,483);
    Sleep(1000);
    Send("Username");
    Sleep(2000);
    Send("{TAB}");
    Sleep(2000);
    Send("Password");
    Sleep(2000);
    MouseClick("left",1188,655);
    Sleep(10000);
    MouseClick("left",1328,180);
    Sleep(2000);

   MouseClick("left",160,678);  ;Task
   Sleep(2000);

   MouseClick("left",26,88);
   Sleep(2000);

   If WinActivate("Untitled - Task","") Then
        ControlClick("Untitled - Task","","RichEdit20WPT3");
        ;At this location I wanted to paste the copied excel data. and I don't know how I solve this step.

Thanks in advance.

 

how to post code

Edited by Jos
Please use Code box for source ;)
Link to comment
Share on other sites

You know that there is an Outlook UDF?
This means you do not have to automate the Outlook GUI but simply call functions as you do with Excel.
What do you try to do with Outlook? Create an email, a contact ...?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Is my understanding correct that you want to

  1. Extract data from Excel
  2. Create a Task in Outlook with data from Excel
  3. I'm not sure about this: Grab some data from Pineapple CRM and add this to the Task. Maybe this is done by a Pineapple Outlook Add in?

1. and 2. can easily be done using the Excel and OutlookEX UDF. But I'm not sure about 3.

Can you please tell us if I'm correct and what Pineapple exactly does in creating a Task?

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

If the Pineapple Outlook addin provides a COM interface I suggest to use COM to create a task.
Else I suggest to use AutoIt's Control* functions to automate the Outlook GUI. Send and Mouse* functions are not very reliable as they depend on screen resolution, window position and might interfere with user actions.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...