473,473 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

TransferSpreadsheet works on some pcs but not on others.

4 New Member
I am using MS Access 2000. I have an application that Imports different spreadsheets from a MS Excel 2000 workbook that exists on the network.

When I run the application on 2 of the pcs, the transferspreadsheet works - every time.

When I run the application on 2 other pcs, the transferspreadsheet does not work - every time.

The input file is always the same. The table that I'm importing into is always the same, and already exists.

I have researched the possibility that MS Access on the various pcs are not at the same version (or possibly MS Excel). But have had no luck finding any differences. Help!
Dec 20 '06 #1
8 1988
willakawill
1,646 Top Contributor
I am using MS Access 2000. I have an application that Imports different spreadsheets from a MS Excel 2000 workbook that exists on the network.

When I run the application on 2 of the pcs, the transferspreadsheet works - every time.

When I run the application on 2 other pcs, the transferspreadsheet does not work - every time.

The input file is always the same. The table that I'm importing into is always the same, and already exists.

I have researched the possibility that MS Access on the various pcs are not at the same version (or possibly MS Excel). But have had no luck finding any differences. Help!
Hi
This sounds like a network problem and possibly user permissions on your network
Dec 21 '06 #2
bob almady
4 New Member
Thanks for the response. However, I am the network administrator, and I have run the application logged onto all of the pcs as the network administrator, with the same results. It works on some pcs but not others.
Dec 21 '06 #3
willakawill
1,646 Top Contributor
Thanks for the response. However, I am the network administrator, and I have run the application logged onto all of the pcs as the network administrator, with the same results. It works on some pcs but not others.
Great. Can you post code please?
Dec 21 '06 #4
bob almady
4 New Member
Th input spreadsheet has 14 tabs, Mon Days, Mon Nights, Tues Days, Tues Nights, weds......, thurs, fri, sat, sun
The Path is always the same and the FileName is always the same(for a given week)..
The day of the week is selected and the 2 spreadsheets for that day are imported into MS Access using the Transferspreadsheet. Row 6 on each spreadsheet contains the headings of the fields.

Here is the guts of the code.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Public Function ImportFromElginProdRptXLS(PathString, ProdRprtFileName)
  3. Dim DayName As String
  4. Dim DayNameCounter As Integer
  5. Dim ProdRptPathAndFileName As String
  6. '
  7. ' CALLED FROM IMPORTSCREEN
  8. '
  9. ProdRptPathAndFileName = PathString & "\" & ProdRprtFileName
  10.  
  11. DayNameCounter = Form_ImportScreenElgin.DayofWeekListBox.ListIndex
  12. If DayNameCounter = -1 Then
  13.    ImportFromProdRptXLS = DayNameCounter
  14.    Exit Function
  15. End If
  16.  
  17. DayName = Form_ImportScreenElgin.DayofWeekListBox.ItemData(DayNameCounter)
  18. On Error GoTo TransferSpreadsheetDay_failed
  19. If DayNameCounter = 0 Then
  20.  
  21.    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
  22.      "ProductionReportXLS", ProdRptPathAndFileName, True, "MON-DAYS!A6:AU150"
  23.    On Error GoTo TransferSpreadsheetNight_failed
  24.    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
  25.      "ProductionReportXLS", ProdRptPathAndFileName, True, "MON-NIGHTS!A6:AU150"
  26. End If
  27. If DayNameCounter = 1 Then
  28. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
  29.     "ProductionReportXLS", ProdRptPathAndFileName, True, "TUES-DAYS!A6:AU150"
  30. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
  31.     "ProductionReportXLS", ProdRptPathAndFileName, True, "TUES-NIGHTS!A6:AU150"
  32. End If
  33. If DayNameCounter = 2 Then
  34. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
  35.     "ProductionReportXLS", ProdRptPathAndFileName, True, "WEN-DAYS!A6:AU150"
  36. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
  37.     "ProductionReportXLS", ProdRptPathAndFileName, True, "WEN-NIGHTS!A6:AU150"
  38. End If
  39. .... for each day ....
  40.  
  41.  
Dec 22 '06 #5
willakawill
1,646 Top Contributor
The first thing that pops into my head is how the pcs are setup for date and time. If this works on the same network on one pc and not on another there are usual suspects and this is prime. Users, as you know, sometimes change settings that cause problems like this.
Dec 22 '06 #6
Killer42
8,435 Recognized Expert Expert
Don't know whether this will help or not, but can we get some detail on exactly how it "doesn't work"? What happens on the "bad" PCs?
Dec 23 '06 #7
bob almady
4 New Member
I was able to solve the problem! The gory details follow.

The Transferspreadsheet was not producing any error messages because I had suppressed warning messages using
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False
  2.  
Commenting that command out allowed me to get messages. Though the messages were not very helpful.

I finally just tried to import the spreadsheet manually within the MS Access application, and then the messages started to have some value.

Through much research I was able to discover that 3 of the 46 columns in the Excel file that I was importing were defined with General format although the data in the fields was numeric, and the fields in the MS Access table had them defined as Number 0 Decimal. (It had been working fine for a year on 2 pcs like this, but not on 2 other pcs).

I nevertheless modified the format of the columns in the Excel file to be Numeric, hoping that would solve it. By itself, this did not solve the problem. It turns out that I also apparently had to refresh the receiving table in the MS Access application (I made no changes to it). Until I did that, the change of format in MS Excel did not make a difference.
Dec 29 '06 #8
willakawill
1,646 Top Contributor
I was able to solve the problem! The gory details follow.

The Transferspreadsheet was not producing any error messages because I had suppressed warning messages using
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False
  2.  
Commenting that command out allowed me to get messages. Though the messages were not very helpful.

I finally just tried to import the spreadsheet manually within the MS Access application, and then the messages started to have some value.

Through much research I was able to discover that 3 of the 46 columns in the Excel file that I was importing were defined with General format although the data in the fields was numeric, and the fields in the MS Access table had them defined as Number 0 Decimal. (It had been working fine for a year on 2 pcs like this, but not on 2 other pcs).

I nevertheless modified the format of the columns in the Excel file to be Numeric, hoping that would solve it. By itself, this did not solve the problem. It turns out that I also apparently had to refresh the receiving table in the MS Access application (I made no changes to it). Until I did that, the change of format in MS Excel did not make a difference.
Nasty bug. Congratulations
Dec 30 '06 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Randy Harris | last post by:
I'm using TransferSpreadsheet to transfer data from A2K to an Excel spreadsheet that has some pivot tables in it. It seems like it is working, but when I open the spreadsheet, it gets an error...
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: Hank | last post by:
Hello, I use TransferSpreadsheet on a daily basis using a Table as a datasource. I was under the impression from reading Help that you could also use a Query as the datasource. This is my code:...
4
by: Google Boy of Company C | last post by:
Hi Does anyone know why there seems to be a file name limit of 60 characters in Transferspreadsheet. I am exporting some records and this is giving me severe grief. I keep getting a message...
13
by: aleksandra_83 | last post by:
Hello, I have searched all over google groups and internet, but I have not found a solution to this problem that has worked. The solutions I found helped me single out the line that is causing...
0
by: Dave | last post by:
Ok...here's a good one. I wrote an ADP application in ACCESS XP with a SQL 2000 back end. Works Great! Recently we did a server migration and transfered the database to another server. Setup...
5
by: Dave | last post by:
Ok...here's a good one. I wrote an ADP application in ACCESS XP with a SQL 2000 back end. Works Great! Recently we did a server migration and transfered the database to another server. Setup...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.