Hi,
In the application I'm working on, I need to export a *large* portion of an Excel sheet into an external database and import it back. I wrote a program in Visual FoxPro 6.0 that would connect to an Excel sheet currently open and do the transfer, and all was well, until I figured I don't know how to launch it from Excel. After some digging in manuals, I rearranged procedures as OLEPUBLIC class' components (tested it again - while launching from FoxPro's side everything worked), compiled it into .exe and tried to call it as a COM "server" from Excel. The CreateObject seemed to work, but the very first call to object's procedure made Excel stuck for a couple of minutes, then it started to throw a message "Microsoft Office Excel is waiting for another application to complete an OLE action" periodically, which only could be stopped by killing the "server" process from the Task Manager.
Now, my current guess of the problem is that both applications are trying to see each other as a server and themselves as a client, which supposedly is a no-no. But I don't know how to resolve this situation. I can't make the FoxPro program a client application calling for the Excel server, as the Excel is what the user works with, and all parameters of the data exchange are set from there. And I'm not sure whether I can access Excel's contents directly from Foxpro if the latter works as a server. If I try to pass data to be transferred as functions' parameters, one row at a time, I'm afraid it's going to be unacceptably slow (didn't I say the piece of sheet is large?). Worse than that, I may need to call for a dialog from Fox' part as well, which, AFAIK, is not possible for a COM.
Thanks for any enlightening advice.
In the application I'm working on, I need to export a *large* portion of an Excel sheet into an external database and import it back. I wrote a program in Visual FoxPro 6.0 that would connect to an Excel sheet currently open and do the transfer, and all was well, until I figured I don't know how to launch it from Excel. After some digging in manuals, I rearranged procedures as OLEPUBLIC class' components (tested it again - while launching from FoxPro's side everything worked), compiled it into .exe and tried to call it as a COM "server" from Excel. The CreateObject seemed to work, but the very first call to object's procedure made Excel stuck for a couple of minutes, then it started to throw a message "Microsoft Office Excel is waiting for another application to complete an OLE action" periodically, which only could be stopped by killing the "server" process from the Task Manager.
Now, my current guess of the problem is that both applications are trying to see each other as a server and themselves as a client, which supposedly is a no-no. But I don't know how to resolve this situation. I can't make the FoxPro program a client application calling for the Excel server, as the Excel is what the user works with, and all parameters of the data exchange are set from there. And I'm not sure whether I can access Excel's contents directly from Foxpro if the latter works as a server. If I try to pass data to be transferred as functions' parameters, one row at a time, I'm afraid it's going to be unacceptably slow (didn't I say the piece of sheet is large?). Worse than that, I may need to call for a dialog from Fox' part as well, which, AFAIK, is not possible for a COM.
Thanks for any enlightening advice.