views:

515

answers:

3

I want to develop a small tool which for open XML file and launch Excel automatically. The benefit for user who could save the excel file to .xls format very conveniently.

My Dev IDE: Windows XP pro & Visual Studio 2005.

The tool will running at Windows 2000 & Excel 2000. and there is no .net framework installed.

That means i can't code with C#. My choice is C++.

+6  A: 

Oneliner:

int main() {
    system("Start Excel test.xml");
}
MSalters
Very Nice one :) +1
Aviator
We have the sme app in my company, it's called... mm... a human-being =)
Clement Herreman
Which reminds me: http://www.thinkgeek.com/tshirts-apparel/unisex/frustrations/374d/
Tomalak
Hi MSalters,Good day.I test like your said. but i really not good effect.1st. I want to parser my XML with some C++ functions.2nd. i want to convert the passer result data to .csv.3rd. i could take user your guide to start my .csv with my Excel file. Any more suggestion?Thank you in advance.BRNano
nano
Still trivial - read XML (any parser will do), process as desired, write .csv file, call `system("start Excel test.csv");`
MSalters
A: 

If I recall correctly you want to open an excel file and then auto launch xml editor?

A way is to add a option the the contect menu when rightclicking on the xls file.

Use register for this: HKEY_CLASSES_ROOT.xls\shell\

create a key (Default) and value something like "Open excel and xml editor" create a folder "command" and a key (Default) with value "path to your exe" "%L" in that folder.

Then in your app catch the param (which holds the xls) and then do something like this:

system(<var holding the xls name>);
system(<path to xml editor>):
PoweRoy
A: 

You could use ShellExecute. It will automatically start program which associated with certain extension, or you could select program manually.

Kirill V. Lyadvinsky