473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do I Pass a UNC Filename as Parameter

34
Hi, All,

I recently got smart and decided to go from a drive-specific path to a UNC path in a GetObject statement. Of course, now I have the syntax to contend with which is being digitally belligerent. I think I have two problems...

1) The full server path I have is \\swba.adpr.acme.com\data\business-eod. Wouldn't this be too much info. for a UNC pathname? Isn't it simply \\server\folder\file? Do I have three server labels here before I even GET to my folder name? I tried excluding the last two labels and still get same errors (below).

2) Should I leave brackets in or out? My impression was that in a GetObject statement, brackets were for data outside the db. I've changed it 2+ ways. With brackets, I get the "External Name Not Defined" error. If I leave out the brackets I get the "Expected: expression" error on the first backslash of the double backslash.

I'm going mental with what was SUPPOSED to make automating code easier. Any ideas?

Expand|Select|Wrap|Line Numbers
  1. ' This next procedure opens Outlook by retrieving e-mail template...
  2. ' The error lines in this & each forthcoming procedure block simply tell the code where to go in event of error.
  3.  
  4. On Error GoTo PROC_ERR
  5.  
  6. Dim objOutlookMsg As Object
  7.  
  8. objOutlookMsg = GetObject([\\swba.adpr.acme.com\data\business-eod\A1 Form Button Automation Email Templates\A1 Outlook Template.oft])
  9.  
  10. Debug.Print ("Open Outlook by getting template object")
  11.  
  12. PROC_EXIT:
  13. Exit Sub
  14.  
  15. PROC_ERR:
  16. MsgBox "Error opening Outlook by getting template object." & vbCrLf & Err.Number & Err.Description, vbExclamation + vbOKOnly, "Get Outlook Thru Template"
  17.  
  18. Resume PROC_EXIT
  19.  
Any input will be appreciated. Thank you.

Frank
Jan 17 '12 #1
4 2128
soule
34
Solved. Had to drop brockets and add string quotes. Yay.
Jan 17 '12 #2
NeoPa
32,556 Expert Mod 16PB
Frank, I've changed this title for you as well as your last one. Please check out the threads at the top of the Access forum as they give some very helpful information that will put you in a much better position to ask your questions properly and thus get speedy answers.

Some general VBA advice :
  1. Declare (dimension) object items precisely where possible. This will help you. Believe me.
  2. Use the F2 Object Browser (See Debugging in VBA) to find what you need.
  3. Use Context-Sensitive Help to determine which parameters are required for a procedure. It would have told you that both parameters for GetObject() are string-type parameters.

This doesn't mean we're not happy to help, and answer your questions, but you strike me as the type of person who's beyond asking for the basics when you have a simple route to finding them yourself.
Jan 17 '12 #3
soule
34
NeoPa,

Thanks for the links. Sorry if I came across as leeching in my posts today, but I'm under immense pressure on this project, not a natural/voluntary programmer and my memory for new technical details (like syntax) is just average. I'll be getting into the F2 Obj. Browser more. Thanks.

Frank
Jan 18 '12 #4
NeoPa
32,556 Expert Mod 16PB
Pressure does things to people Frank. Often helping them to forget all they know and panic :-D You'll be fine I'm sure, and we're still happy to help.
Jan 18 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Phoenix | last post by:
Is there any way to disable being able to shut down a program totally? I would have to allow it to be closed when the computer is shutting down or the user is logging out, but other than that it...
5
by: The Eternal Squire | last post by:
All, Regardless of the technical difficulties involved (and I know they are legion), I am considering developing a very limited subset of Python fit to run on embedded systems using 80188 or...
0
by: il barbi | last post by:
I delivered a test DB where in the main form there are some frames with associate object with Word files (linked). Now the customer asks me how to get the pathname of the Word files and indeed I...
3
by: phil | last post by:
We are developing specs. for a website for a nonprofit org, with database for membership related functions. But..question is regarding drop down menu links. We will have 20 category-pages, and...
2
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
4
by: Diogo Alves - Software Developer | last post by:
Hi, I have a application developed by me in C# that does not let windows shut down! What is the problem? is this a Framework bug? I would like to receive some feedback about this issue
1
by: abcN123 | last post by:
Hi, I'm learing c# and needed some help with dropdown lists relations. For example, 2 DDL will be dates that corespond to one and other. I am trying to make it so that each DDL selection automaticly...
4
by: mark4asp | last post by:
How can I shut down (only one) ASP.NET website on the server. Problem. I have updated my web-site but the site which I see is the old one (the one there prior to the update). I do I force...
1
by: haritha reddy | last post by:
can anyone tell how to pass pathname as an argument to file name?
14
by: DanicaDear | last post by:
I have a QTY field and an ITEM field. User inputs a number into the QTY field, then tabs over the the next field and there's a down arrow on the right hand side of the field that you click to choose...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.