Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / November 2006

Tip: Looking for answers? Try searching our database.

strange error message

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Song Su - 23 Nov 2006 13:36 GMT
My code worked before, but now has strange message. The error message is:
'ActiveX component can't create object'

My code is below:

Private Sub cmdExport_Click()
On Error GoTo cmdExport_Err
Dim answer As Integer
Dim fs, d
   answer = MsgBox("Insert a disk in A: Ready to export?", vbOKCancel +
vbDefaultButton2)

   If answer = 1 Then
       ' Check to see if A: is ready
       Set fs = CreateObject("Scripting.FileSystemObject")
       Set d = fs.GetDrive("A:")
       If d.IsReady Then
           DoCmd.TransferDatabase acExport, "dBase IV", "a:\", acQuery,
"ActiveQuery", "Active.dbf"
           MsgBox "Export completed"
       Else
           MsgBox "A: drive is empty. Export canceled"
       End If
   Else
       MsgBox "Export canceled"
   End If
cmdExport_Exit:
   Exit Sub

cmdExport_Err:
   MsgBox Error$
   Resume cmdExport_Exit

End Sub
Stefan Hoffmann - 23 Nov 2006 13:47 GMT
hi Song,

> My code worked before, but now has strange message. The error message is:
> 'ActiveX component can't create object'
Comment out the error handler. At which line does the code execution stops?

> Private Sub cmdExport_Click()
> On Error GoTo cmdExport_Err
> Dim answer As Integer
> Dim fs, d
Better declare fs and d as Object, not as Variant.

>     answer = MsgBox("Insert a disk in A: Ready to export?", vbOKCancel +
> vbDefaultButton2)
>
>     If answer = 1 Then
>         ' Check to see if A: is ready
>         Set fs = CreateObject("Scripting.FileSystemObject")
If it stops here, then the Scripting library is not properly installed.

mfG
--> stefan <--
Song Su - 23 Nov 2006 13:52 GMT
Thanks for quick reply. It does stop at createobject. how to reinstall
scripting library?

> hi Song,
>
[quoted text clipped - 19 lines]
> mfG
> --> stefan <--
Stefan Hoffmann - 23 Nov 2006 14:00 GMT
hi Song,

> Thanks for quick reply. It does stop at createobject. how to reinstall
> scripting library?
Reinstall or repair one of the following products:

- Windows Script Host
- VBScript
- Internet Explorer
- Microsoft Office

mfG
--> stefan <--
Song Su - 23 Nov 2006 16:53 GMT
I reinstalled Windows Script Host and problem solved.
Thank you.

> hi Song,
>
[quoted text clipped - 9 lines]
> mfG
> --> stefan <--
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.