473,480 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

File Not Found Error on String File reference

1 New Member
I have the following code:
Expand|Select|Wrap|Line Numbers
  1. Dim fname As Integer
  2. fname = cboPlanYearBPTCreation.Value
  3.  
  4. Dim BPTExcelFile As String
  5. BPTExcelFile = "C:\Program Files\PBP" & fname & "\CY" & fname & "MA BPT.xls"
  6. Dim BPTExcelXLA As String
  7. BPTExcelXLA = "C:\Program Files\bpt" & fname & "\BPT" & fname & ".xla"
  8.  
  9. Dim App As Excel.Application
  10. Dim Wkbk As Excel.Workbook
  11.  
  12. On Error GoTo ErrorHandler
If I dim the Excel filenames as constants and hard-code in the fname (which is just 2008 or 2008), the erro handler works, but if I use the above code with the fnames embedded in the strings, the errorhandler is ignored. Can I create a dynamic path based on the value of a combo box and call an error handler if the path doesn't exist?

Thanks,
Neuman
Feb 18 '08 #1
2 1743
FishVal
2,653 Recognized Expert Specialist
Hello, Neuman.

Are you sure that the error occurs after "On Error" statement has been executed?

Regards,
Fish
Feb 18 '08 #2
NeoPa
32,556 Recognized Expert Moderator MVP
What do you mean by "the error handler works" and "call an error handler"?
I'm having difficulty understanding what you mean when you describe what's going wrong.
Feb 22 '08 #3

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

Similar topics

4
4755
by: comcast news | last post by:
at least i think it this is the problem am trying to fix a webpage/javascript that i didn't write www.deltaneutral.com when invoked or any new page from the menu, get the error msg line 2...
3
3789
by: David B | last post by:
I have this code to find a file, place it in C:\ temp, zip it up then send it to floppy in drive A:\. When I run it it comes up with error 53 - source file not found. However it gets as far as...
9
10854
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
0
1921
by: karunakar | last post by:
Hi All I am not able to read the class name I want read the particular class name string path = System.Configuration.ConfigurationSettings.AppSettings; string className = path + ".User";...
0
3903
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
2
2077
by: AAguiar | last post by:
Thanks for your replies. Last week, I continued working with this problem. Trying to reproduce the error, I developed a short example and found that the problem is related to strong name dll. ...
1
5031
by: Olav Tollefsen | last post by:
I get the included error message when trying to run my ASP.NET application under Windows Server 2003 (with all updates installed). How can I troubleshoot this? Olav File or assembly name...
2
5019
by: John Regan | last post by:
Hello All I am trying to find the owner of a file or folder on our network (Windows 2000 Server) using VB.Net and/or API. so I can search for Folders that don't follow our company's specified...
2
6077
by: js | last post by:
I got this error when I moved my application to a new Windows 2003 server. I installed and recompiled the 'Microsoft.Practices.EnterpriseLibrary - June 2005" then added these assemblies to the...
5
64572
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C++ programming. FYI Although I have called...
0
7041
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
6908
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
7044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7084
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...
1
6739
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
6929
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
5337
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,...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.