Jump to content
Sign in to follow this  

Excell Attatch

Recommended Posts


When ever I try to attach to any excel workbook it keeps giving me a error messgae. Error 191

#include <Excel.au3>
#include <File.au3>

$sFilePath = @TempDir & "\Temp.xls"
If Not _FileCreate($sFilePath) Then ;Create an .XLS file to attach to
    MsgBox(4096, "Error", " Error Creating File - " & @error)

$oExcel = _ExcelBookAttach($sFilePath) ;with Default Settings ($s_mode = "FilePath" ==> Full path to the open workbook)
_ExcelWriteCell($oExcel, "If you can read this, then Success!", 1, 1) ;Write to the Cell
MsgBox(0, "Exiting", "Press OK to Save File and Exit")
_ExcelBookClose($oExcel, 1, 0) ;This method will save then Close the file, without any of the normal prompts, regardless of changes

dose anyone know how to use this.

Thank You

Share this post

Link to post
Share on other sites

Thats the example from the help file and it works ok for me.

GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post

Link to post
Share on other sites

Can you specify what fails exactly? Also, I have one script which intensively uses Excel files but I never use _ExcelBookAttack -- to my knowledge you can just use _ExcelBookOpen and use the returned handle. Isn't _ExcelBookAttach used when Excel is already running? Please correct me when I'm wrong :mellow:

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