Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Open excel on client side with ASP VBScript

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,1534
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Open excel on client side with ASP VBScript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Open excel on client side with ASP VBScript - 10/28/2004 1:20:10 AM   
  kristofseyen

 

Posts: 5
Score: 0
Joined: 10/28/2004
From:
Status: offline
Hi,

I have made the following page in ASP VBScript:
http://studweb.khk.be/S5039425/opdr1/student/default.asp
This is a page for a specific school, where students can see there specific timetable. That works fine, and after choosing Semester1 or Semester2 excel should open. To open excel i use the following code:


      

For this code to work you should change your internet settings as following:
1. Tools>>internet options>>security>>custom level>>ActiveX controls and plugins
2. enable "initialize and script activeX controles not marked as safe"

Now i'm looking for some code wich i have to add to my code (on my ASP VBScript-page) wich will automaticly adjust the internet settings. So the user (client) won't have to do this by himself.

friendly greetings Kristof
 
 
Post #: 1
 
 Re: Open excel on client side with ASP VBScript - 10/28/2004 2:03:54 AM   
  wils0n

 

Posts: 14
Score: 0
Joined: 10/27/2004
From:
Status: offline
Why not just link directly to the Excel file using HTML?

By doing so, you shouldn't have to use any client-side code or change any security settings, which is a terrible idea anyway.

(in reply to kristofseyen)
 
 
Post #: 2
 
 Re: Open excel on client side with ASP VBScript - 10/28/2004 3:39:12 AM   
  kristofseyen

 

Posts: 5
Score: 0
Joined: 10/28/2004
From:
Status: offline
It's not a option to link directly to the excel file because i need the VBScript to jump to the worksheet of the selected class (with the jumpmenu's) => see this link http://studweb.khk.be/S5039425/opdr1/student/default.asp

(in reply to kristofseyen)
 
 
Post #: 3
 
 Re: Open excel on client side with ASP VBScript - 10/28/2004 4:22:56 AM   
  wils0n

 

Posts: 14
Score: 0
Joined: 10/27/2004
From:
Status: offline
Ahh.. that wasn't in the original post..
Just out of curiosity, is the Excel file generated on-the-fly, or is it a static document?

(in reply to kristofseyen)
 
 
Post #: 4
 
 Re: Open excel on client side with ASP VBScript - 10/28/2004 4:37:45 AM   
  kristofseyen

 

Posts: 5
Score: 0
Joined: 10/28/2004
From:
Status: offline
The excel file is a static document... the server doesn't make any changes to the excel file. And excel isn't installed on the server

(in reply to kristofseyen)
 
 
Post #: 5
 
 Re: Open excel on client side with ASP VBScript - 10/28/2004 8:23:42 AM   
  kristofseyen

 

Posts: 5
Score: 0
Joined: 10/28/2004
From:
Status: offline
Doesn't anyone know how you can change the activeX settings on the client side with a ASP VBScript page????

(in reply to kristofseyen)
 
 
Post #: 6
 
 Re: Open excel on client side with ASP VBScript - 10/29/2004 2:54:12 AM   
  wils0n

 

Posts: 14
Score: 0
Joined: 10/27/2004
From:
Status: offline
Let me see if I understand your problem.

You want to serve client-side vbscript to somebody else's Internet Explorer that programatically changes their security settings, without the user's explicit permission, to "initialize and script activeX controles not marked as safe".

If this functionality exists in IE, wouldn't that make IE even more insecure than it is already made out to be?

If you could do that, wouldn't you be opening a hole for spyware, etc?

It's not that nobody knows how. It's that such a feature probably does not and should not exist.

(in reply to kristofseyen)
 
 
Post #: 7
 
 Re: Open excel on client side with ASP VBScript - 11/1/2004 8:44:34 PM   
  kristofseyen

 

Posts: 5
Score: 0
Joined: 10/28/2004
From:
Status: offline
You're close :-)

i thing i don't said it good :-)(my english is not so best)
i would like to have sommething like this: a message box wich will say "would you like to change your internet settings..." with the buttons yes and no, if they click yes, then the settings will be changed. you understand it?

and is this possible???

(in reply to kristofseyen)
 
 
Post #: 8
 
 Re: Open excel on client side with ASP VBScript - 11/2/2004 2:06:51 AM   
  wils0n

 

Posts: 14
Score: 0
Joined: 10/27/2004
From:
Status: offline
Here are a few references I found. It doesn't look too easy, but it does look possible. Some of these ideas might work, depending on what you are willing to trade off in ease-of-use.

http://support.microsoft.com/kb/q182569/

Usenet Thread

Another Usenet Thread

And some code from one of those threads:

IE "security settings" are stored in the registry under this key:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\
and under the appropriate \zones\ subkey in HLKM and HKCU

This code was designed for something similar. It should show you the path.
you could add a shortcut in IE's right-click menu, or bookmark it
Let me know if you want to alter Office security settings as well ;-)


'VB Script to change IE security settings
Option Explicit

Const MY_COMPUTER_ZONE = 0
Const LOCAL_INTRANET_ZONE = 1
Const TRUSTED_ZONE = 2
Const INTERNET_ZONE = 3
Const RESTRICTED_ZONE = 4

Dim WSHShell
Dim a,b,c,i,z
Dim reg(1)


' These key names contain the permissions to want to set
' Look in the registry to get the right key names

reg(0) = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\" _
& "SO\COOKIE\CookiePersistent\Query\"

reg(1) = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\" _
& "SO\COOKIE\CookieSession\Allow\"


Set WSHShell = WScript.CreateObject("WScript.Shell")

' looping through the array of keys:
For i = LBound(reg) To UBound(reg)

' these tell you what to write:
a = WSHShell.RegRead(reg(i) & "RegPath")
b = WSHShell.RegRead(reg(i) & "ValueName")
c = WSHShell.RegRead(reg(i) & "CheckedValue")

' For z = 0 To 4 ' use a loop here to write to each zone
z = INTERNET_ZONE

' write the key
WSHShell.RegWrite "HKCU\" & Replace(a, "%s", z) & "\" & b, _
c, "REG_DWORD"

' Next

Next


-------------------------------------------------------

I have no idea if that code can be repurposed for your app, but that's about all I could find on the topic.

Good luck.

(in reply to kristofseyen)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Open excel on client side with ASP VBScript Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts