very puzzled and could use some help here...I have a script that basically takes info online and places it into excel. I heavily rely on the, XL.range("A1").select and XL.Range("A2").Value commands. I've been building a script up with these commands for over a week, everything was fine even upto about 3 hours ago. However now I get an error (0x800A03EC) and it points to the bottom command, the .select command. Below is a small excerpt that even taken out of context should work. The excel file opens, becomes active, but fails on the bottom line.
Any suggestions what is happening here? The only thing that could of remotely affected this was that before this stopped working I tried looking for a debug tool. Came across the xDebugclient (https://lexikos.github.io/v2/docs/AHKL_DBGPClients.htm). I started to install it but the installation failed for not finding the .net files online ?!?!?? Sequentially I can not remember when my script stopped but the above is the only thing that changed on my computer
RunWait, C:\Users\New_HP\Downloads\DS - Script.csv
WinActivate, DS - Script.csv - Excel
Sleep, 333
XL := ComObjCreate("Excel.Application") ;enables the XL COM communication link
XL.range("A1").select
EXCEL COM suddenly stopped working
-
- Posts: 16
- Joined: 04 Jul 2017, 19:49
- divanebaba
- Posts: 806
- Joined: 20 Dec 2016, 03:53
- Location: Diaspora
Re: EXCEL COM suddenly stopped working
Hi.
To fill a cell in Excel with AHK, I'm using this code:
As you can see, I'm opening a template XLS-file called FileNameTmp.
FileNameTmp has to be defined before like something like this:
Without a template to open I get similar or same error message as you.
To fill a cell in Excel with AHK, I'm using this code:
Code: Select all
xlApp := ComObjCreate("Excel.Application")
xlApp.Visible := True
xlApp.Workbooks.Open(FileNameTmp)
xlApp.Range("A1").Value := myVariable
FileNameTmp has to be defined before like something like this:
Code: Select all
FileNameTmp = %A_ScriptDir%\ahk_templates\Invoice.xls
Einfach nur ein toller Typ.
-
- Posts: 16
- Joined: 04 Jul 2017, 19:49
Re: EXCEL COM suddenly stopped working
@Divanebaba
Thanks. Not sure what changed and why this works vs the other method. But it gets me back up and running.
Thanks. Not sure what changed and why this works vs the other method. But it gets me back up and running.
Who is online
Users browsing this forum: jollyjoe and 313 guests