Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 26th, 2007, 10:57 AM
Registered User
 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error 3011 after installation to another pc


I did an ADP (Access 2000) for a sports event, in this adp I used DoCmd.TransferSpreadsheet acExport to export a list of participants to an excel file, this file was used to insert results and then the results where imported by DoCmd.TransferSpreadsheet acImport.

Here the Code passage

'export
DoCmd.TransferSpreadsheet acExport,acSpreadsheetTypeExcel9, "ListePktExp", "C:\Dokumente und Einstellungen\All Users\Desktop\MyFile.xls", True
........

the import went similar, only that there first I used a loop to check the drives for the file 'MyFile.xls'


'Excel Daten ins Zwischenlager 'ListePktExp'
 Set ds = CreateObject("Scripting.FileSystemObject")

 For Each dsObj In ds.Drives
     If dsObj.DriveType = 1 Or dsObj.DriveType = 4 Then
        With Application.FileSearch
                        .NewSearch
                        .LookIn = dsObj.DriveLetter & ":\"
                        .FileName = "MyFile.xls"
                        .SearchSubFolders = True
'as soon as the file is found use the path to import
             If .Execute > 0 Then
                DoCmd.TransferSpreadsheet acImport,acSpreadsheetTypeExcel9, "ListePktExp", dsObj.DriveLetter & ":\"& .FileName, True
             End If
         End With
       End If
 Next

Everything worked well, but now I transfered the adp to a notebook and there everything works fine except the DoCmd.Transferspreadsheet when I try to export it causes the Runtime Error 3011,JetDatabase engine could not find the object, and when importing there is something similar, named runtime error 3251

I checked the spelling, I tried to put the file and path name in a string variable, I checked for missing libraries, I compared the office installation (on both machines it's office 2003 and XP Pro)

I am very happy if someone has an idea what to do, thanks a lot, bluebear


 
Old February 26th, 2007, 10:59 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

The obvious quest is, are you sure that the file you are exporting to does, in fact, exists?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429





Similar Threads
Thread Thread Starter Forum Replies Last Post
VC++ 2005 PC ERROR @ PC STARTUP -JUST IN TIME DBUG CPPGUY Visual C++ 2005 0 October 3rd, 2008 12:52 PM
Run Time Error 3011 joebob_houston Access VBA 3 May 3rd, 2007 06:38 AM
Subscript error...but only on my PC kalebson Excel VBA 2 March 1st, 2006 03:00 PM
403 error after installation David C Veeneman BOOK: Professional DotNetNuke ASP.NET Portals ISBN: 0-7645-9563-6 1 September 4th, 2005 01:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.