473,320 Members | 1,600 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,320 software developers and data experts.

FileSystemObject in Visual Basic

I'm a newbie to Visual Basic. I have been recently working with text
files, but for some reason my computer gives me an error: "Compile
Error: User Defined Type Not Defined". It highlights fso as new
filesystemobject. An example of the code is:

Private Sub Command1_Click()
Dim fso as new filesystmobject, txtfile

My operating system is Windows XP Home Edition. I already have
scrrun.dll. I am using Visual Basic 6.0 Standard Edition. Thanks in
advance.

James Carter
Jul 17 '05 #1
2 21213
Hi james,

You need to reference the FSO from the Project Menu / References menu
option.

In that list you'l see either Microsoft File System Object or FSO make suer
that's checked and try to run your code again.

--
Stéphane Richard
Senior Software and Technology Supervisor
http://www.totalweb-inc.com
For all your hosting and related needs
"James Carter" <uo*******@yahoo.com> wrote in message
news:d5**************************@posting.google.c om...
I'm a newbie to Visual Basic. I have been recently working with text
files, but for some reason my computer gives me an error: "Compile
Error: User Defined Type Not Defined". It highlights fso as new
filesystemobject. An example of the code is:

Private Sub Command1_Click()
Dim fso as new filesystmobject, txtfile

My operating system is Windows XP Home Edition. I already have
scrrun.dll. I am using Visual Basic 6.0 Standard Edition. Thanks in
advance.

James Carter

Jul 17 '05 #2
"James Carter" <uo*******@yahoo.com> wrote in message
news:d5**************************@posting.google.c om
I'm a newbie to Visual Basic. I have been recently working with text
files, but for some reason my computer gives me an error: "Compile
Error: User Defined Type Not Defined". It highlights fso as new
filesystemobject. An example of the code is:


the FSO is designed for use from VBScript, not VB. There's almost always a
better way to accomplish things using native VB statements and/or API calls.
If you are just starting then do yourself a favor and don't get hooked on
something that can be unreliable due to the existence of multiple,
not-quite-compatible versions and users who have scripting disabled... if
you can't find the VB way to do something search http://groups.google.com
and/or post your questions

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: pix | last post by:
Hello, I would like to start learning Visual Basic, and I was wondering if there are any recomendations to any ebooks, or actual books for that matter. I have my eye on this book by John Smiley,...
2
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
2
by: Ralph | last post by:
I used to have Visual Basic .net std. 2003 installed on WinXP SP1A. But I found it too hard to upgrade WinXP to SP2. Now, I do have WinXP SP2 installed, but I am having problems installing...
2
by: frossberg | last post by:
Hello! I tried to install the Visual Basic.NET Resource Kit (http://msdn.microsoft.com/vbasic/vbrkit/) but obviously something went very wrong and now it sems impossible both to repair and to...
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
3
by: brigitte | last post by:
The original problem: I need a procedure to import a csv file created by a third party application into an Access database. This file contains fields which may include commas, and when they do,...
11
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have seen the terms Visual Basic 2005 and VB.NET. It seems that sometimes they seem to be referring to the same thing but sometimes they are not. I also run into terms like VB9 and VB10.
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.