Solved

vba to open txt file on Sharepoint

Posted on 2011-02-22
6
1,199 Views
Last Modified: 2012-05-11
Hi all, I have an application that opens and reads a txt file.

It works fine locally but when I try to run it on sharepoint I get Error number 75. I checked the file path and it is correct (I'm able to paste the link in a browser and see the text in the file)

Open (sHolidayfile) For Input As #1

It breaks on this line on sharepoint. Can someone help?
0
Comment
Question by:boukaka
  • 3
  • 3
6 Comments
 
LVL 6

Expert Comment

by:sabby447
ID: 34958704
Is this file part of sharepoint or on the file system, You may want to move the file in hive folder under layouts i.e. c:\program files\common files\microsoft shared\web server extension\12 or 14 depending on which version of sharepoint you are using then template\layouts and have a folder for this file .

You can now call this file using \_layouts\foldername\filename.vbs from any of your application and it should be called

For the code to run, What is the code that you are running, Maybe its worth trying to move this to a web page code
0
 

Author Comment

by:boukaka
ID: 34960415
I do not have access to the file system, this is a mega-corporation and getting through the red-tape and approvals process to have the file moved to the server is not feasible, that would take weeks, maybe months and I don't have time to wait.
0
 
LVL 6

Expert Comment

by:sabby447
ID: 34973443
Try putting a relative url in sharePoint, not sure if you are already doing that or not, How are you calling the vbs script inside the sharepoint
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:boukaka
ID: 34973572
The user opens an excel spreadsheet that resides on Sharepoint. They click a button that does a bunch of stuff including opening and reading from my little txt file. Can you please explain "relative url"??
0
 
LVL 6

Accepted Solution

by:
sabby447 earned 500 total points
ID: 34974922
Hunh as i understant the macro's are not supported in excel services : http://social.msdn.microsoft.com/Forums/en/sharepointexcel/thread/d388d3c2-1163-4e6c-b759-e9f4b4ac60c5

if you are downloading the file to a machine and then using the excel then it will connect to local machine and not sharepoint server hard drive

Relative url : ./foldername/filename.txt inside your sharepoint and not the full url i.e. http://sitename/foldername/filename.txt
0
 

Author Closing Comment

by:boukaka
ID: 34974953
Ok, thanks
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question