I'm trying to make a program that takes info from Excel. So far so good but when it finishes Excel always asks me if I want to save. I use close(); to get out of Excel but when I tried to find the 'don't save' arguements on the interget the Visual C++ Express assembler tells me that close doesn't take 1, 2, or even 3 arguements. Does anybody have familiarity with this issue and can help me?
Not OLE Automation. I'm using COM interface, or at least I hope that's what it's called.
My work found out that I'd taken some programming classes six years ago and decided to see what I could do during our businesses down time. I'm struggling with this and frankly, most of it is a Frankenstein program from various parts of the web.
What is the purpose of your program? If you're trying to manipulate Microsoft Office only, you might be better off just using the inherent VBA Scripting language. I was actually in a very similar situation as you for a while.
The problem is that I remember most of the stuff from my Introduction to C++ class but I've never touched VBA and have no clue how it works.
I'm basically having my program open seven different Excel workbooks, copy some information from specific cells, and then manually type it out into our database software (which the program opens as well.)
I've got the program to work like a champ with two issues. It fouls up when it switches to the second workbook (working on that) and I can't figure out how to get it to close a workbook without saving. I'm even wondering if the two might be related (won't open a second workbook while the other is mid-closing or some such.)
I suspect that most of the problem that you're having is in interfacing between C++ and the native language of Microsoft scripting, which as I said earlier is VBA. If you convert your project to VBA, I think that you'll find that a few days of research will have you well placed to perform your function. On the other hand, you could always contact me by PM, and I could do it for you, but I would charge your company.
He's not interfacing with VBA at all. He's using Automation to control Excel. Like I said, setting Saved to true should do the trick just fine. You can look up the documentation in MSDN (search for workbook.saved).