vba to open txt file on Sharepoint

Posted on 2011-02-22
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?
Question by:boukaka
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Expert Comment

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

Author Comment

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.

Expert Comment

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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.


Author Comment

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"??

Accepted Solution

sabby447 earned 500 total points
ID: 34974922
Hunh as i understant the macro's are not supported in excel services :

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

Author Closing Comment

ID: 34974953
Ok, thanks

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will show you how to use shortcut menus in the Access run-time environment.
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

730 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