exe(vc++) & Excel 
Author Message
 exe(vc++) & Excel

Hello All,

I am new to VC++..!!
I want to run an exe  application written in VC++ from excel.
This exe can be run on its own, but while called from excel using shell
method it gives an error "Debug Assertion Failed"

The VC++ code is the following -
#include <stdio.h>
#include <stdlib.h>

int main()
{
int a,b,c;

FILE *ifp,*ofp;
char ifn[]="trial.in",ofn[]="trial.out";
ifp=fopen(ifn,"r");
ofp=fopen(ofn,"w");

fscanf(ifp,"%d %d %d",&a,&b,&c);
fprintf(ofp,"%d %d %d",a,b,c);

    return 0;

Quote:
}

This is the  macro in Excel :-

    Myapp = Shell("c:\debug\trial.exe", 1)

    AppActivate Myapp

Or is there any other way to execute the exe from excel. ???

Thanks in advance for the help.



Fri, 11 Jan 2002 03:00:00 GMT  
 exe(vc++) & Excel
The assert is telling you something.  Look at it and try to figure out
what is missing or wrong.  Is the assert happening in your code or
in Excel?  What does the call stack tell you?
--
Dan Evens
Standard disclaimers etc. No spam please.



Quote:
> I want to run an exe  application written in VC++ from excel.
> This exe can be run on its own, but while called from excel using shell
> method it gives an error "Debug Assertion Failed"

[snip]


Fri, 11 Jan 2002 03:00:00 GMT  
 exe(vc++) & Excel
The error is happening when I try to call the exe from the excel macro.
It gives the Abort/Retry/Ignore dialog box.
[
Program : trial.exe
file : fscanf.c
Line :54

Expression stream != Null
]

(I hv not worked on VC++.
I hv to use excel to run the executable & get the results so I hv no idea
how to debug in VC++ or what else can be done!!)

Thanks

Quote:

>The assert is telling you something.  Look at it and try to figure out
>what is missing or wrong.  Is the assert happening in your code or
>in Excel?  What does the call stack tell you?
>--
>Dan Evens
>Standard disclaimers etc. No spam please.



>> I want to run an exe  application written in VC++ from excel.
>> This exe can be run on its own, but while called from excel using shell
>> method it gives an error "Debug Assertion Failed"
>[snip]



Fri, 11 Jan 2002 03:00:00 GMT  
 exe(vc++) & Excel


Quote:
> The error is happening when I try to call the exe from the excel macro.
> It gives the Abort/Retry/Ignore dialog box.
> [
> Program : trial.exe
> file : fscanf.c
> Line :54

> Expression stream != Null
> ]

It looks like fscanf is telling you a file is not open, though it's a
little
tough to tell.

This suspiciously looks like you have not given trial.exe something
it needs to run. Maybe it needs command line arguments?
Is it possible that while running from the Excel session you have a
different default directory, so trial.exe is not finding a file that it
does find when you run it from the command prompt?

Quote:
> (I hv not worked on VC++.
> I hv to use excel to run the executable & get the results so I hv no idea
> how to debug in VC++ or what else can be done!!)

Well, I'd guess you are in trouble then, unless one of my guesses up there
is correct.  Maybe you can get hold of the person who wrote trial.exe
and get him or her to help you?

--
Dan Evens
Standard disclaimers etc. No spam please.



Fri, 11 Jan 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. adding columns to excel with dao & vc++

2. adding columns to excel with dao & vc++

3. Accessing Excel file & Excel file format

4. Splitting MFC EXE to EXE & DLL

5. vc++,excel kb example error compiling

6. vc++ .net, excel kb example error compiling

7. vc++, excel kb article compile error

8. excel programming in vc++ resources

9. excel programming in vc++ resources

10. How Can I Link *.exe to VC or link C program to VC

11. Is there a way to debug VC 1.52 EXE with VC 5.0

12. How to Create a Property Ctrl like ClassView&ResourceView&InforView in VC

 

 
Powered by phpBB® Forum Software