Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default problem with code

Hi,

I have in a code the following sentence:
set fs=CreateObject("Scripting.filesystemobject") .....

before it was working fine in my macro but I had a problem with my computer
and I had to install everything again and now this marcro sotps in this line
, I think I have to include somthing in the references but I do not know
what...

any idea?

thank you

ana
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default problem with code

Hi Ana,

no, you don't need to set reference with late binding.
You need to "dim fs as object" first

Or you can set reference to "Microsoft Scripting Runtime" (early
binding), and code like this:
dim fs as scripting.filesystemobject
set fs=new scripting.filesystemobject

Regards,
Ivan

  #3   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default problem with code

if I add
dim fs as scripting.filesystemobject

there is an error in this line

but my macro was working fine last week the same code (it has been working
fine for almost a year) and now after someone touched my computer we had to
install everything again that is the only diference...........


"Ivan Raiminius" wrote:

Hi Ana,

no, you don't need to set reference with late binding.
You need to "dim fs as object" first

Or you can set reference to "Microsoft Scripting Runtime" (early
binding), and code like this:
dim fs as scripting.filesystemobject
set fs=new scripting.filesystemobject

Regards,
Ivan


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default problem with code

Hi,

if you add
dim fs as scripting.filesystemobject
you should also set the reference to "Microsoft Scripting Runtime".

When your original code stops, what is the error message?

Regards,
Ivan

  #5   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default problem with code

it was that the missing reference to "Microsoft Scripting Runtime".
thank you

Ana

Ivan Raiminius" wrote:

Hi,

if you add
dim fs as scripting.filesystemobject
you should also set the reference to "Microsoft Scripting Runtime".

When your original code stops, what is the error message?

Regards,
Ivan




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default problem with code

Ana,
changes are that you do not need the fso at all.
VBA has built in ways of achieving the majority of its functionality..and
faster also.

NickHK

"Ana" wrote in message
...
Hi,

I have in a code the following sentence:
set fs=CreateObject("Scripting.filesystemobject") .....

before it was working fine in my macro but I had a problem with my

computer
and I had to install everything again and now this marcro sotps in this

line
, I think I have to include somthing in the references but I do not know
what...

any idea?

thank you

ana



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default problem with code

That should read "Chances are..."

NickHK

"NickHK" wrote in message
...
Ana,
changes are that you do not need the fso at all.
VBA has built in ways of achieving the majority of its functionality..and
faster also.

NickHK

"Ana" wrote in message
...
Hi,

I have in a code the following sentence:
set fs=CreateObject("Scripting.filesystemobject") .....

before it was working fine in my macro but I had a problem with my

computer
and I had to install everything again and now this marcro sotps in this

line
, I think I have to include somthing in the references but I do not

know
what...

any idea?

thank you

ana





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alt Code Problem aftamath77 Excel Discussion (Misc queries) 2 February 10th 09 11:42 PM
Code problem Patrick Simonds Excel Programming 1 October 16th 05 12:03 AM
Code Problem Tim Excel Programming 2 June 24th 05 10:29 PM
Code Problem TC[_8_] Excel Programming 8 November 30th 04 07:09 PM
Problem with the following code Vince Excel Programming 3 November 19th 04 08:51 AM


All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"