473,287 Members | 1,413 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

TransferSpreadsheet fails in simple reproducible example

Hi,

Has anyone seen this weird behaviour or have any suggestions or can
anyone reproduce it?

The history:

I converted a large third party DB from 97 to XP and it uses the
TransferSpreadsheet method. This method requires a somewhat
complicated spreadsheet to be open in order to work. A simple
spreadsheet does not have this pre-open requirement.

Access XP is on Citrix and Office 2000 is on the desktop - don't ask!
The users cannot open the spreadsheet locally (as they used to)
because Access and Excel cannot communicate across the Citrix
boundary. I decided to open the spreadsheet on Citrix using
automation and then let the existing code do its thing.

All testing is with local copies of Access XP (SP2) and Excel 2000
(SP3) with Jet4.0 (SP8) on WinXP (SP1). I ran into some weird errors
and managed to isolate them in a separate simple project.

The problem:

Create an Excel spreadsheet with some simple column headers and a
couple of rows of data and save it as "C:\Temp\Test.xls". Create a
new DB and add the supplied code to a module.

Run the TestLots procedure once and all is good.

** Open the task manager and check for rogue copies of EXCEL.EXE -
this seems to be a critical step and usually there are no instances
but not always.

Run the procedure a second (or third) time and the TransferSpreadsheet
method fails with a Run-Time error '3000' - as an aside, click the
Help button and get a blank screen.

Any help would be greatly appreciated. I'm going to test it on Office
2000 at home tonight. I highly suspect its the XP/2000 mix - or, with
some luck, something very simple like a property called "add random
errors". Restarting Access and killing any copies of Excel fixes the
problem for the first execution.

Const strTEST_XLS = "C:\Temp\Test.xls"

Private Sub TestBothFails()
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Open strTEST_XLS, ReadOnly:=True
DoCmd.TransferSpreadsheet _
TableName:="HelloWorld", Filename:=strTEST_XLS
objExcel.Quit
Set objExcel = Nothing
End Sub

Public Sub TestLots()
Dim intCount As Integer
For intCount = 1 To 5
Debug.Print "Pass number " & intCount
TestBothFails
Next
End Sub
Nov 12 '05 #1
0 2153

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: O'Donnell Tribunal | last post by:
Hello Everybody, I am using the TransferSpreadsheet method to import spreadsheets for processing. say my code looks like this: DoCmd.TransferSpreadsheet acImport, 0, _ "tbltempImport1", ""...
1
by: Bill Agee | last post by:
How do you specify a specific worksheet? I know this works if the worksheet in question is the 1st, but suppose I am interested in importing several worksheets from the same workbook. There does...
1
by: Bob Hynes | last post by:
Hi All, In Access97 I'm using a TransferSpreadsheet acExport in vba code and it errors when the spreadsheet I'm exporting does not exist. If I create a empty spreadsheet with the name I use in the...
3
by: user_5701 | last post by:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of code: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000, "tblTest", pathAndFilename, True The above line...
2
by: Tomek | last post by:
I've tried DoCmd.TransferSpreadsheet( 1, 8, "aaa" , "d:\\ddd.xls", false, NULL, true); but it fails GREAT THANKS for help T.
0
by: robert.waters | last post by:
Hello, When executing DoCmd.TransferSpreadsheet to an .xls file that's being used as a datasource for a Word mail merge document, if that Word document is currently open, the TransferSpreadsheet...
3
by: sranilp | last post by:
Hey All, Actually I need to export the data from Access to Excel particular spreadsheet(ie.Raw Data),so I was using Docmd.Transferspreadsheet but in this syntax where i can give the spreadsheet...
2
by: rlntemp-gng | last post by:
re:Access 2003 TransferSpreadsheet has worked in my app for weeks now. Now, the day I was to put in production (today) it crashes the app, and users are livid...but not more than me...
3
by: Icarus | last post by:
I'm using TransferSpreadsheet to import an Excel file in to MS Access 2003. DoCmd.TransferSpreadsheet acImport, 8, strTable, strFileName, True, "" One of the columns in the Excel file is a...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.