Sign in to follow this  
Followers 0
rr62

Calling Notepad from Excel VBA using AutoITX3 Type Library

3 posts in this topic

I am a new comer to AutoITX3. I will be  using the AutoIT from within Excel VBA. I added AutoItX 1.0 Type library to my VBA using Tools - Refernces command. I am trying to write  to Notepad from within Excell.  I am using Notepad as a first step before using richer applications. I identified the Window Info for Notepad using AutoIT v3 Window Info tool.

(I tried to post the Window info as a screen shot as bmp and jpeg in this post.  I got a warning message  "You are not allowed to use that image extension on this community.")

Sub TestNotepad()
    Dim autoit As AutoItX3
    Set autoit = New AutoItX3

    autoit.Run "notepad.exe"
    autoit.Sleep (100)         ' Wait for note to finish loading
    autoit.ControlSend "Untitled - Notepad", "", "[CLASSNN:Edit1]", "This is a test"

End Sub

However, the notepad does not open up.with a message. Also, I am not able to see Immediate window. I have tried Windows 7 (64 bit machine -- but used AutoIt  3 regular version in compatibility mode (not 64 bit mode) and not beta version) with Excel 2007. Also, no luck with Windows XP with Excel 2003 as well. 

Any ideas as to how fix the problem would be appreciated.

Thanks.

Ram

Share this post


Link to post
Share on other sites



 

"You are not allowed to use that image extension on this community.")

I suspect you need to have at least 10 posts to upload files to the forum.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Have you tried to put all the AutoIt processing into a single compiled script and start it from VBA?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0