Excel errors

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Excel errors

Post by SandyDoss » Tue Mar 06, 2018 12:11 am

Hi,

We're working with an Excel workbook that is giving us problems.

Our code (minimally, as we can't get past the open), is as follows:

Code: Select all

let>ws-name-file=C:\Users\Administrator\Desktop\sandy.xlsx
XLOpen>ws-name-file,1,ws-work-handle
Wait>1
MessageModal>opened file
XLGetCell>ws-work-handle,MIDLAND,1,1,ws-result
messagemodal>result=%ws-result%
XLQuit>ws-work-handle
When we run this, at the XLOpen line we get the following error: Call was rejected by callee (see attachment)
In the attached image, you can see that Excel has launched in the task manager. In fact, if we manually open the spreadsheet before aborting the macro, we get the notification that the spreadsheet is locked for editing, so I know it's being opened, but we can't see it. When we click 'OK' on the rejection error, that error window closes, but MS hangs on the XLOPEN command and does nothing further.

So: The pc we are running on is a Windows 7 Professional, with Office 2016 installed.
There are no other processes accessing the file (or Excel, for that matter)
The version of Office 2016 is licensed appropriately.
We can open other spreadsheets with this small script, with no problem. That, to me, points to the workbook itself. But I have no clue as to how to debug this.

Anyone have any ideas on what we might be running into? The spreadsheet itself has no macros or programming behind it as far as I can see. There are embedded links to GoogleDrive, but I can't imagine that would be an issue.

Thanks in advance,

Sandy

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Excel errors

Post by Marcus Tettmar » Tue Mar 06, 2018 12:22 pm

My guess is the workbook is somehow "busy". What are these GoogleDrive links?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Re: Excel errors

Post by SandyDoss » Tue Mar 06, 2018 3:39 pm

Hi, Marcus,

The links go to specific directories on a Google Drive to display a set of available documents. I don't know how to tell if the workbook is 'busy' - so I'm looking for some debug things I can do. The links to Google drive are the only thing I can think of that might be getting in the way. We're 'googling' the issue, and will run a test on the spreadsheet without that column, but that column is a major part of the whole point in the macro we're writing.

If anyone has any ideas, I'm open :wink:
Thanks

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Excel errors

Post by Marcus Tettmar » Tue Mar 06, 2018 3:58 pm

I can't think of anything obvious so I think it would be good to remove that column temporarily just to eliminate it from enquiries! Worth checking. Then go from there.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Excel errors

Post by Marcus Tettmar » Tue Mar 06, 2018 4:02 pm

Also, can you check that there are no dialogs being shown when the Excel file is opened? Only asking because a google search suggests that a common cause of this is Excel displaying a dialog on startup.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Re: Excel errors

Post by SandyDoss » Tue Mar 06, 2018 4:32 pm

So, just as a test, I copied the workbook, removed all sheets except 1, removed the column with the hyperlinks, and could (using the macro script) open the workbook, visibly see the spreadsheet, pick a cell and display the contents. So the hyperlinks are the culprit.

Possibly excel is checking for an invalid link? I haven't found yet any documentation on what background processes go into embedding hyperlinks in Excel, yet, but am looking.

Will post back when I find something.

SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Re: Excel errors

Post by SandyDoss » Tue Mar 06, 2018 4:34 pm

Also, there are no dialogs being shown. In fact, even when I set the macro to make the spreadsheet visible, I cannot see it. I only know it's open by a) task manager, and b) manually opening it gets me 'it's locked for editing' message.

SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Re: Excel errors

Post by SandyDoss » Wed Mar 07, 2018 3:23 pm

Well, I finally found someone with the same issue.

Here is their post:
https://superuser.com/questions/562598/ ... -opens-the

Will update if I don't kill my pc while jerking with the registry. :evil:

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts