By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,083 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,083 IT Pros & Developers. It's quick & easy.

Opening Excel on client side

P: n/a
Hello,

i am starting PHP, and after 2 days of search, i am posting.

MY PURPOSE : opening a XLS files (in MS Excel) on the client side, the
user can update anything, then it will be automaticly saved on the
server again (when client use save button or close Excel).

MY TESTS : I had coded that (in php) :
echo "<FORM METHOD=post TARGET=_blank> ";
echo "<INPUT TYPE='button' VALUE=Open the file'
onClick='ouvrir(\"myfileexcel.xls\")'>";
echo "</FORM>";
---------------------------------------------------------------------------*-----

Actualy that doesn't work, my button is here but do nothing when you
clic it.
---------------------------------------------------------------------------*-----
function ouvrir($nomfic)
{
# test to check the call :
echo "COUCOU";
# $workbook = "docs/".$nomfic;
# $sheet = "myshet";
# $ex = new COM("Excel.sheet");
# $wkb = $ex->application->Workbooks->Open($workbook) or Die ("File do
not open");
# $ex->application->ActiveWorkbook->Close("False");
# unset ($ex);
}
MY QUESTION : Anyone know how to do this (with code example plz) ?

PS : i am french so sorry for my bad english.

Dec 20 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
je*************@province-sud.nc says...
MY PURPOSE : opening a XLS files (in MS Excel) on the client side, the
user can update anything, then it will be automaticly saved on the
server again (when client use save button or close Excel).


Impossible to be able to do if the client has even the smallest ideas
about security of their own computer. I will NEVER allow a web site to
spawn an executable program on my client, let alone know to where on my
file system I may choose to save it as a download.

You are using the wrong application methodology, trying to hammer a nail
with a screwdriver. What you need to achieve this is MS Terminal Server
or Citrix.

Geoff M

Dec 20 '05 #2

P: n/a
it's an intranet (not internet) so security isn't my problem.
Plus i already hammered a nail with a screwdriver....several times,
it's painfull (specialy for my fingers) but can be done.. ;-))

Djim.

Dec 20 '05 #3

P: n/a
If you pass the browser an xls file, it will auto open most client's
excel (or an excel plugin) to read the doc..

Dec 20 '05 #4

P: n/a
Yes it open my file, but user can't save it back directly on the server.

Dec 21 '05 #5

P: n/a
Djim wrote:
Hello,

i am starting PHP, and after 2 days of search, i am posting.

MY PURPOSE : opening a XLS files (in MS Excel) on the client side, the
user can update anything, then it will be automaticly saved on the
server again (when client use save button or close Excel).

MY TESTS : I had coded that (in php) :
echo "<FORM METHOD=post TARGET=_blank> ";
echo "<INPUT TYPE='button' VALUE=Open the file'
onClick='ouvrir(\"myfileexcel.xls\")'>";
echo "</FORM>";
---------------------------------------------------------------------------*-----

Actualy that doesn't work, my button is here but do nothing when you
clic it.
---------------------------------------------------------------------------*-----
function ouvrir($nomfic)
{
# test to check the call :
echo "COUCOU";
# $workbook = "docs/".$nomfic;
# $sheet = "myshet";
# $ex = new COM("Excel.sheet");
# $wkb = $ex->application->Workbooks->Open($workbook) or Die ("File do
not open");
# $ex->application->ActiveWorkbook->Close("False");
# unset ($ex);
}
MY QUESTION : Anyone know how to do this (with code example plz) ?

PS : i am french so sorry for my bad english.

PHP se lance chez le serveur. Lorsque l'utilisateur voit le bouton, PHP
s'est évanoué.
Seulement un système au client, p.e. Javascript, peut se lancer par
onClick - mais il n'aura pas accès aux fichiers sur le serveur.

Si l'utilisateur demande une nouvelle page ( par submit ou par un lien )
le PHP de cette page pourra ouvrir et afficher un fichier. Mais ça ne
permettra pas que l'utilisateur y puisse faire des changements au
fichier. Le script peut l'envoyé comme download, puis l'utilisateur
pourra lancer son propre Excel s'il y en a, mais il n'y aura aucun
methode de rentre le fichier changé au serveur.

Je ne sais aucun moyen d'arriver à ce que vous voulez.

Colin

Désolé pour ma mauvaise français.
Dec 21 '05 #6

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Djim wrote:
Yes it open my file, but user can't save it back directly on the server.


Use a PUT-enabled webserver (webdav-like), and make sure that the client app
(i.e. excel) is able to save to http:// URLs.

At least, any KDE app can do it...

- --
- ----------------------------------
Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

Give a man a fish, he owes you one fish.
Teach a man to fish, you give up your monopoly on fisheries.
(read on slashdot.org)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDqLn43jcQ2mg3Pc8RApSuAJ9wUeEEHFvJF3rNzEBciB fx7zg/egCeJ8P+
Qi6aIAJNxmIn5J6zJF6hNCk=
=c10+
-----END PGP SIGNATURE-----
Dec 21 '05 #7

P: n/a
For the level of integration you desire, you will probably need to use
an ActiveX control, that in turn hosts the Excel ActiveX control. With
a RAD tool like Borland Delphi or VB, you can do it fairly easily. Drag
an Excel control and a web access component, add a few lines of code,
then bingo!

Dec 21 '05 #8

P: n/a
Ok thx all for the tips, and specialy Colin with nice french ;-))

Dec 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.