Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


vba to open txt file on Sharepoint

Posted on 2011-02-22
Medium Priority
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


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 2000 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

Author Closing Comment

ID: 34974953
Ok, thanks

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

636 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