|
-
Mar 16th, 2006, 08:27 AM
#1
Thread Starter
Fanatic Member
connect to client excel application
I want to open Microsoft Excel on a client machine.
Then add some data to a workbook and save the workbook on the users computer on a predefined place (without the user having to save the document).
I've only been able to write documents to a local path on the webserver, but not on a client. My Boss keeps saying it is possible, but i can't find out how.
Can anybody help me?
-
Mar 18th, 2006, 06:49 AM
#2
Re: connect to client excel application
You can do it one of two ways:
Create the Excel file on the server, then write to the user's machine in a response stream (so that they are prompted to save it).
Or,
Create an ActiveX control which the users must install on their machines which will write the Excel files to their hard drives.
-
Mar 21st, 2006, 05:39 AM
#3
Thread Starter
Fanatic Member
Re: connect to client excel application
 Originally Posted by mendhak
Create an ActiveX control which the users must install on their machines which will write the Excel files to their hard drives.
I've created my ActiveX control. Is it possible to give me an example how to link the activeX control to the asp.net-page / asp.net-project? Will Internet Explorer ask the user to install this activeX component or should i add special code to do this?
-
Mar 21st, 2006, 09:20 AM
#4
Re: connect to client excel application
IE will prompt the use to install this control. Other browsers will ignore the ActiveX control.
To place an ActiveX control on your web page, first of all, find out its CLSID. You either have this already, or you can run through the registry and find it.
Then,
HTML Code:
<OBJECT ID="MyObject1" CLASSID="CLSID:6F83F556-4DAF-11D2-B06F-0020186313EF"
CODEBASE="MyOCXFileName.OCX">
</OBJECT>
-
Mar 21st, 2006, 09:47 AM
#5
Thread Starter
Fanatic Member
Re: connect to client excel application
Is it possible to access this object from the code-behind-window?
I want to call a public sub that is defined in my activeX.
-
Mar 21st, 2006, 10:38 AM
#6
Re: connect to client excel application
No you cannot. But you could do it with javascript...
HTML Code:
var ax;
ax = new ActiveXObject('object.name');
ax.FunctionName();
-
Mar 21st, 2006, 11:14 AM
#7
Thread Starter
Fanatic Member
Re: connect to client excel application
how can i pass a string-parameter and a date-parameter to my function
Can i do it lile this?
HTML Code:
ax.MaakAgendaPunt('test1', 'test2', #21/03/2006#, #22/03/2003#, 'Here');
Do I use single quotes for strings and "railroad"-marks (#) for dates, or am i mistaking?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|