Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Is the floppy in the A drive?

I would like to determine if the floppy in the "A" drive and if it is post a
msgbox saying so. I have not been able to do this and haven't seen any
messages on the subject.

Can someone please help me?.
Thanks

Jim


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Is the floppy in the A drive?

try this

Function FloppyInDrive()
Dim sTemp

On Error GoTo haveError
sTemp = Dir("A:\")
FloppyInDrive = True
Exit Function

haveError:
FloppyInDrive = False
End Function

Tim.

"jim simpson" wrote in message
news:54Kpd.2597$QR.2064@lakeread01...
I would like to determine if the floppy in the "A" drive and if it is
post a
msgbox saying so. I have not been able to do this and haven't seen
any
messages on the subject.

Can someone please help me?.
Thanks

Jim




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Is the floppy in the A drive?

Another option:

Option Explicit
Sub testme03()

'Dim FSO As Scripting.FileSystemObject
Dim FSO As Object

'Set FSO = New Scripting.FileSystemObject
Set FSO = CreateObject("scripting.filesystemobject")

With Application
If FSO.Drives("a").IsReady Then
MsgBox "ok"
Else
MsgBox "not ready"
End If
End With
End Sub


If you uncommment the top lines of each pair (and comment the bottom), you'll
have to set a reference (tools|references) to Microsoft Scripting Runtime.

When you have that reference set, you'll get the VBE's intellisense to help you
complete your code.



jim simpson wrote:

I would like to determine if the floppy in the "A" drive and if it is post a
msgbox saying so. I have not been able to do this and haven't seen any
messages on the subject.

Can someone please help me?.
Thanks

Jim


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Is the floppy in the A drive?

Thanks to both Tim and Dave for responding.

Dave sometning doesn't work with the top lines of each pair commented out. I
get a complaint about "ScriptingFileSystemObject". It says "User defined
type not defined". I'm using Excel 2000 with Win98, could that be the
problem?

Jim


"Dave Peterson" wrote in message
...
Another option:

Option Explicit
Sub testme03()

'Dim FSO As Scripting.FileSystemObject
Dim FSO As Object

'Set FSO = New Scripting.FileSystemObject
Set FSO = CreateObject("scripting.filesystemobject")

With Application
If FSO.Drives("a").IsReady Then
MsgBox "ok"
Else
MsgBox "not ready"
End If
End With
End Sub


If you uncommment the top lines of each pair (and comment the bottom),

you'll
have to set a reference (tools|references) to Microsoft Scripting Runtime.

When you have that reference set, you'll get the VBE's intellisense to

help you
complete your code.



jim simpson wrote:

I would like to determine if the floppy in the "A" drive and if it is

post a
msgbox saying so. I have not been able to do this and haven't seen any
messages on the subject.

Can someone please help me?.
Thanks

Jim


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Is the floppy in the A drive?

"jim simpson" wrote in message
news:xX%pd.2784$QR.1669@lakeread01...
Thanks to both Tim and Dave for responding.

Dave sometning doesn't work with the top lines of each pair commented out.
I
get a complaint about "ScriptingFileSystemObject". It says "User defined
type not defined". I'm using Excel 2000 with Win98, could that be the
problem?

Jim


If you want to use early binding which is more efficient you need to go to
Tools | References in the VBA editor and check the box next to Microsoft
Scripoting Runtime, or use the browse button to find scrrun.dll in your
system directory. Then you use:

Dim FSO As Scripting.FileSystemObject
Set FSO = New Scripting.FileSystemObject

This also gives you intellisense support. If setting a refence is going to
be awkward then you can use late binding with:

Dim FSO As Object
Set FSO = CreateObject("scripting.filesystemobject")

--

Joe (MVP)




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Is the floppy in the A drive?

Jim,

Both Dave's methods worked for me in Win98 / XL2000

If you uncomment the first pair you need to comment the second pair AND set
a reference to Microsoft Scripting Runtime, the way Dave described.

Regards,
Peter


"jim simpson" wrote in message
news:xX%pd.2784$QR.1669@lakeread01...
Thanks to both Tim and Dave for responding.

Dave sometning doesn't work with the top lines of each pair commented out.

I
get a complaint about "ScriptingFileSystemObject". It says "User defined
type not defined". I'm using Excel 2000 with Win98, could that be the
problem?

Jim


"Dave Peterson" wrote in message
...
Another option:

Option Explicit
Sub testme03()

'Dim FSO As Scripting.FileSystemObject
Dim FSO As Object

'Set FSO = New Scripting.FileSystemObject
Set FSO = CreateObject("scripting.filesystemobject")

With Application
If FSO.Drives("a").IsReady Then
MsgBox "ok"
Else
MsgBox "not ready"
End If
End With
End Sub


If you uncommment the top lines of each pair (and comment the bottom),

you'll
have to set a reference (tools|references) to Microsoft Scripting

Runtime.

When you have that reference set, you'll get the VBE's intellisense to

help you
complete your code.



jim simpson wrote:

I would like to determine if the floppy in the "A" drive and if it is

post a
msgbox saying so. I have not been able to do this and haven't seen any
messages on the subject.

Can someone please help me?.
Thanks

Jim


--

Dave Peterson





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Is the floppy in the A drive?

Thanks Guys, for all hte great help.

Clicking on the "Microsoft Scripoting Runtime" box did the trick. Now I have
2 solutions to my problem.

Jim

"Peter T" <peter_t@discussions wrote in message
...
Jim,

Both Dave's methods worked for me in Win98 / XL2000

If you uncomment the first pair you need to comment the second pair AND

set
a reference to Microsoft Scripting Runtime, the way Dave described.

Regards,
Peter


"jim simpson" wrote in message
news:xX%pd.2784$QR.1669@lakeread01...
Thanks to both Tim and Dave for responding.

Dave sometning doesn't work with the top lines of each pair commented

out.
I
get a complaint about "ScriptingFileSystemObject". It says "User defined
type not defined". I'm using Excel 2000 with Win98, could that be the
problem?

Jim


"Dave Peterson" wrote in message
...
Another option:

Option Explicit
Sub testme03()

'Dim FSO As Scripting.FileSystemObject
Dim FSO As Object

'Set FSO = New Scripting.FileSystemObject
Set FSO = CreateObject("scripting.filesystemobject")

With Application
If FSO.Drives("a").IsReady Then
MsgBox "ok"
Else
MsgBox "not ready"
End If
End With
End Sub


If you uncommment the top lines of each pair (and comment the bottom),

you'll
have to set a reference (tools|references) to Microsoft Scripting

Runtime.

When you have that reference set, you'll get the VBE's intellisense to

help you
complete your code.



jim simpson wrote:

I would like to determine if the floppy in the "A" drive and if it

is
post a
msgbox saying so. I have not been able to do this and haven't seen

any
messages on the subject.

Can someone please help me?.
Thanks

Jim

--

Dave Peterson







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
Launching Excel causes floppy drive access Jules Excel Discussion (Misc queries) 3 March 2nd 06 02:36 AM
How repeat a task on all files on a floppy drive ED007 Excel Discussion (Misc queries) 3 August 17th 05 03:01 PM
floppy not accessible in a drive L Findlay Excel Discussion (Misc queries) 1 April 8th 05 03:26 AM
floppy not accessible in a drive L. Findlay Excel Discussion (Misc queries) 0 April 8th 05 12:35 AM
Is there a floppy disk in Drive A? Hotbird Excel Programming 1 August 21st 03 11:00 PM


All times are GMT +1. The time now is 02:54 PM.

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

About Us

"It's about Microsoft Excel"