-
Posts
17 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
LazyVasily's Achievements

Seeker (1/7)
0
Reputation
-
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
Error: -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
Juvigy : -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
water, Actually, I've always run scripts from the console. I just started compiling 64. Shows all the same error message. "Error attaching to the workbook! @error=1, extended = -2147352570" -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
water, Excel 2013x64 and Excel2007 Autoit 3.3.14.0 Again specify. File 1.xls-not started with a click. And at the time of running the script file 1.xls is ALREADY open. The script should find the window-not by the file path, but by the name "Title". 1.xls -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
TheSaint, Did everything you told me to do. #include <Excel.au3> #include <MsgBoxConstants.au3> Local $sWorkBook = "1.xls" Local $oExcel = _Excel_Open() If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error creating Excel object! @error = " & @error & ", @extended = " & @extended) Local $oWorkBook = _Excel_BookAttach($sWorkbook, "Title") If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error attaching to the workbook! @error = " & @error & ", @extended = " & @extended) $oWorkBook.ActiveSheet.Shapes.Range("Oval 1").Delete If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error deleting shape! @error = " & @error & ", @extended = " & @extended) This script does not work. Displays a window with the error: "Error attaching to the workbook! @error=1, extended = -2147352570" -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
JoHanatCent, Your script does not work. The script opens an additional copy of file 1.xls (read-only). In this copy - it removes the shape "Oval 1". The script then stops running. As a result - I have one open file 1.xls with two shapes, and one open file 1.xls (read-only) with one shape. No need to open file 1.xls because it's already open. You used the "filename" parameter again. I asked about using $sMode "Title". (https://www.autoitscript.com/autoit3/docs/libfunctions/_Excel_BookAttach.htm ) -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
water, This script still can't find window "1.xls". Shows the error "Error attaching to the workbook". Why do you write about "filename" ? I asked about the "title". -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
water, I'm using your script. #include <Excel.au3> #include <MsgBoxConstants.au3> Local $sWorkBook = "1.xls" Local $oExcel = _Excel_Open() If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error creating Excel object! @error = " & @error & ", @extended = " & @extended) Local $oWorkBook = _Excel_BookAttach($sWorkbook, "title") If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error attaching to the workbook! @error = " & @error & ", @extended = " & @extended) $oWorkBook.ActiveSheet.Shapes.Range("Oval 1").Delete If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error deleting shape! @error = " & @error & ", @extended = " & @extended) The script still can't find the window "1.xls". Shows the error "Error attaching to the workbook". -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
water, I understand. I made changes. The script still can't find the window "1.xls". #include <Excel.au3> #include <MsgBoxConstants.au3> ;Opt('WinTitleMatchMode', -2) Local $sWorkBook = "1.xls" $sExcel = _Excel_Open() If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error creating Excel object! @error = " & @error & ", @extended = " & @extended) $sWorkBook = _Excel_BookAttach($sWorkbook, "title") If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error attaching to the workbook! @error = " & @error & ", @extended = " & @extended) $sWorkBook.ActiveSheet.Shapes.Range("Oval 1").Delete If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error deleting shape! @error = " & @error & ", @extended = " & @extended) Shows the error "Error attaching to the workbook". -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
water, Independently created a script similar to the example in the Help. The script does not work. Shows the error "Error attaching to the workbook". #include <Excel.au3> #include <MsgBoxConstants.au3> Opt('WinTitleMatchMode', -2) $oExcel = _Excel_Open() $sTitle = "1.xls" If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error creating Excel object! @error = " & @error & ", @extended = " & @extended) $oWorkBook = _Excel_BookAttach($sTitle) If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error attaching to the workbook! @error = " & @error & ", @extended = " & @extended) $oWorkBook.ActiveSheet.Shapes.Range("Oval 1").Delete If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error deleting shape! @error = " & @error & ", @extended = " & @extended) #include <Excel.au3> #include <MsgBoxConstants.au3> ;Opt('WinTitleMatchMode', -2) Local $oWorkBook = "1.xls" $oExcel = _Excel_Open() If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error creating Excel object! @error = " & @error & ", @extended = " & @extended) $oWorkBook = _Excel_BookAttach($sWorkbook, "title") If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error attaching to the workbook! @error = " & @error & ", @extended = " & @extended) $oWorkBook.ActiveSheet.Shapes.Range("Oval 1").Delete If @error Then Exit Msgbox($MB_ICONERROR, "Error", "Error deleting shape! @error = " & @error & ", @extended = " & @extended) What have I done wrong ? How to change this script so that it finds the right window 1.xls by Title ? -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
water, But the help is missing an example for "$sMode Title" : https://www.autoitscript.com/autoit3/docs/libfunctions/_Excel_BookAttach.htm -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
water, Advise - as replace "$Mode FileName" on "$sMode Title" in your script (Title of the Excel window) ? In Help no found example for "$sMode Title" (https://www.autoitscript.com/autoit3/docs/libfunctions/_Excel_BookAttach.htm) -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
water, You don't quite understand what I'm asking. Your script works. But it works only in one case. It only works if the file " 1.xls" - will be opened by clicking on the file. If you open the file 1.xls in another way, the script does not work. After all, the file can be opened by hyperlink or simply through the Excel menu. The file thus opened is " 1.xls " - the script does not recognize and displays an error window. I asked - how to remove the shape "Oval 1" if the file 1.xls was opened not by clicking on this file, but in another way ? The file can be opened via the Excel menu (and now AutoIt-script does not see it). -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
water, File 1.xls is open at the time of running your script. An error window appears : -
Remove figure from the open workbook Excel
LazyVasily replied to LazyVasily's topic in AutoIt General Help and Support
AutoBert, This code doesn't work. #include <Excel.au3> $oWorkBook = _Excel_BookAttach(@ScriptDir & "\1.xls") $oExcel = _Excel_Open() $oWorkBook.ActiveSheet.Shapes.Range(("Oval 1")).Delete It works only in rare exceptions - if you close all Excel files and run the desired file 1.xls by clicking on it. In other cases, this code does not work. Gives an error "Variable must be of type Object". How to delete the shape "Oval 1"regardless of how the file 1.xls was open-click or through the Excel program ?