Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old February 26th, 2007, 09:57 AM
Registered User
Join Date: Jan 2007
Location: , , .
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

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
                        .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

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

Reply With Quote
  #2 (permalink)  
Old February 26th, 2007, 09:59 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

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:
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

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 02: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

All times are GMT -4. The time now is 04:32 AM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.