Solved

Invalid procedure call or argument

Posted on 2016-10-11
9
34 Views
Last Modified: 2016-10-17
Hello,

I have downloaded an 'EXCEL' worksheet from a government tax website. I have to fill out some details in this sheet ( .Xlsm )
This sheet has a 'BUTTON' called " Generate XML " 
When i choose this option, it asks me to choose the file name and location. When i choose OK, it comes up with an error.
" Invalid procedure call or argument ".
How do i fix this error and generate an XML file?
This is a protected worksheet and does not allow me to edit the "macros" or choose " file - save as - XML "
I use Excel 2007
Please help
Thanks,
Michael
1.jpg
0
Comment
Question by:Michael Sachin
  • 4
  • 3
9 Comments
 
LVL 25

Expert Comment

by:ProfessorJimJam
ID: 41838133
different to find the issue, without seeing to code or the file.
0
 
LVL 1

Author Comment

by:Michael Sachin
ID: 41838229
Hi,
I have attached the actual Excel file for your reference. The previous post also has an image file with the error.
I hope you can work on this

Thanks for your help,
Michael
Annx-08-Goods_Purchased_in_the_Cour.xlsm
0
 
LVL 25

Assisted Solution

by:ProfessorJimJam
ProfessorJimJam earned 500 total points
ID: 41838619
@Michael Sachin

i have examined the file, i have repeated what you did, added some data and then click Generate XML and then it asked for folder selection and it successfully created XML file.

the reason you face that error is that you use Excel 2007 and the VBA code that generate XML is using a method called "Early Binding" which requires the object reference in VBA reference library.
the current XML library selected in the file is XML 6 while the one in Excel 2007 is the lower version.
2016-10-11-17_32_05-Microsoft-Visual.png
unfortunately, you cannot change that because the VBA is password protected; and breaking the password is easy, however, it is not ok to do so, becuase the author of workbook must have locked it for a reason.

this is one of the mistakes that VBA developers do all the time, using early binding that creates problem with next versions of software and that is why it is preferred to use Late binding method when VBA developers write the code that uses object libraries.

this issue is fixable, but since we do not have the VBA project password, i think it is best to approach the author of the workbook and ask to fix this.

or if author is willing to share with you the unlocked version, then simply Open VBE by pressing ALT + F11 then go to Tools > References then untick the MISSING item and scroll down and select the XML version which is available in your library list. could be version 5 . click save and then it will work.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:Michael Sachin
ID: 41839501
Hello,
Thank you for your effort. I tried the above mentioned options but no go.
I have attached the unprotected worksheet for your reference. Please look into this and
see if you are able to get it to work. I hope you can. I have been trying to work around this for the past
5 days and unable to.

Thanks
Michael
Annx-08-Goods_Purchased_in_the_Cour.xlsm
0
 
LVL 1

Accepted Solution

by:
Michael Sachin earned 0 total points
ID: 41839794
Hi,

I downloaded the previous version of the excel file (V1.0) and it worked fine. I think the issue was that I had used the file that was meant for the mac OS. Attached a screenshot that suggests that.

Issue resolved.

Thanks for your help

Cheers!
Michael
issue.jpg
0
 
LVL 25

Expert Comment

by:ProfessorJimJam
ID: 41841674
you are welcome.

i am glad i was able to help.
0
 
LVL 1

Author Closing Comment

by:Michael Sachin
ID: 41846343
Downloaded file was for the mac OS. Had to download a different file for Windows. Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now