
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ActiveX Component can't create object ""Scripting.FileSystemObject""
Hi,
I've got this error (ActiveX Component can't create object ""Scripting.FileSystemObject"") when I lanch a macro to upload a file with a FTP.
The script is:
sub Upload
set vPath = ActiveDocument.Variables("vPathFile").GetContent
Dim FSO
Dim File
Set FSO = CreateObject("Scripting.FileSystemObject")
Set File = FSO.OpenTextFile("C:\temp.txt", 2, True)
File.WriteLine "open ***-ftp.*************"
File.WriteLine "user"
File.WriteLine "****"
File.WriteLine "*****"
File.WriteLine "cd qlikview/prodis"
File.WriteLine "PUT "& vPath.string
File.WriteLine "disconnect"
File.WriteLine "quit"
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run "ftp -n -s:C:\temp.txt"
End Sub
If i lanch this macro like this, there is no problem...
but if I change the path of the .txt file for example: * **
C:\Users\Public\Documents\temp.txt
I've got an error....
The problem is the users are not Adminstrateur of their computer, so they can't create a txt file in C:
that's why i want to change the path, like that...
I don't know why ActiveX can't create the object with this path wheras it works whith an other.
(My macro has system Access, it's not the problem)
Thanks
DUEZ Thomas
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I too had same issue with Active X component. Can you please ask users to install IE plugin from Access Point and after successfull install ask users to open application and the press Ctrl+Shift+M and give system access to module script.
Let me know if any further info is required.
Regards,
Varsha


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is a security setting within the macro-modul - you need set the access level on the left side from editor to access on extern.
- Marcus
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
the folder C:\Users\Public\Documents\ is available for your users? Which windows version have they?
On my pc(win7) it is working fine.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Marcus: No the Access is alerady set to system etc....
Yes I think "C:\Users\Public\Documents\' is available for all users, even if they're not admin...I think it's a path without security....I'm not sure because I'm consultant, and I work for an other company so I don't manage security here....but I will ask....
On my computer it's also working fine....but on the computer of an users.....with C:\temp.txt there is no problem but with the other path it don't work whereras I can create a document file with no problem in "C:\Users\Public\Documents\' on his computer....that's why I though it was a ActiveX problem (authorization to create there? I don't know)
EDIT: I forget to say, they work also on win7


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I understand right, the txt-file will be created in "C:\Users\Public\Documents\" and then occurs the error message ActiveX Component can't create object ""Scripting.FileSystemObject""?
- Marcus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes exactly...
When the txt-file is created in "C:\" there is no problem (but I can't do that, because the Network admin don't want I create file there) but when i want to create the file in "C:\Users\Public\Documents\" I've got the ActiveX error.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems as if there are not the proper access rights for this path (try it - for testing - elsewhere) and/or ActiveX is on user-level not right configured.
- Marcus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I don't know I will search ....
But in parallel I try to do it differently, I would like to avoid to use txt file and write directly in the shell....
I try that:
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run "ftp -n" 'It opens the shell
shell.sleep 500
shell.SendKeys ("open ***-ftp.partners.*********")
...
But I don't success to write somoething in the shell with the commande SendKeys....
Nothing happened....
Can anyone tell me what's wrong with my script
Tkx


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My experience with SendKeys is quite bad ... and then on user-level ... I wouldn't it recommend and I think it will not solved your problems. Generally the approach to create an txt-file with a ftp-statement and afterwards to execute it worked. If not, then there are problems with access rights and/or proper syntax/config-details.
Have you always the message with ActiveX (FileSystemObject or Shell) or will the shell-statement executed (you should set a statement like "timeout /T 15" in your txt-file therewith you could see what is wrong by the execution)?
- Marcus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I also think that SendKeys is not the solution but if I don't sucess to resolve my problem with twt-file, I search an other way....
Anyway, I still have my problem (it's very random) I don't really understand where is the problem, on some users computer it works and on others no....
But I don't think the timeout can help (but maybe I don't uderstand) because I think the problem is at the creation of the txt-file (not during the execution...) It seems like on some computers, I can't create the txt-file on the computer...
The problem is that I don't know exactly the security in the company I work as a consultant.
When I lanch the application with the rich client, an do "open on server" there is no problem...
the problem appears when we use IE with IE plug-in ( macro don't work in full web version by the way, but it's an other problem)...Do you think the problem is a bad setting of ActiveX....because maybe I can ask to IT team to set it differently...I'm quite lost.

- « Previous Replies
-
- 1
- 2
- Next Replies »