Invalid procedure call or argument


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
Michael SachinAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ProfessorJimJamMicrosoft Excel ExpertCommented:
different to find the issue, without seeing to code or the file.
Michael SachinAuthor Commented:
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,
ProfessorJimJamMicrosoft Excel ExpertCommented:
@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.
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.
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Michael SachinAuthor Commented:
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.

Michael SachinAuthor Commented:

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ProfessorJimJamMicrosoft Excel ExpertCommented:
you are welcome.

i am glad i was able to help.
Michael SachinAuthor Commented:
Downloaded file was for the mac OS. Had to download a different file for Windows. Thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.