473,732 Members | 2,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Transfer spreadsheet functions - unexpainable results...

25 New Member
Good afternoon!

I use transfer spreadsheet function the export data from one of the table into the excel spreat sheet. I use the following code:
DoCmd.TransferS preadsheet acExport, 8, "qry Rejected Items", Path & "Output Files\Rejected Items.xls", True, "NewData"

Please note that the output should be placed in the "NewData" tab.

In the same excel file the output was made to, i have function that is excecuted on open:

Sub Auto_Open()
'msgbox "stop before running code"
Call CheckNewData
ActiveWorkbook. Names.Add "PivotData" , "=OFFSET(Data!$ A$1,0,0,COUNTA( Data!$A:$A),COU NTA(Data!$1:$1) )"
Sheets("Pivot") .PivotTables("P ivotTable1").Pi votCache.Refres h
Sheets("Pivot") .Activate
ActiveWorkbook. Save
End Sub

Public Sub CheckNewData()
On Error GoTo NoNewData
If Len(Sheets("New Data").Name) > 0 Then
'delete old
Application.Dis playAlerts = False
Worksheets("Dat a").Delete
'rename new
Worksheets("New Data").Name = "Data"
Application.Dis playAlerts = True
Else
'error no NewData
MsgBox "New Data Failed!" & Chr(13) & Chr(13) & "Contact Provider", , "Error"
Application.Qui t
End If

NoNewData:
End Sub


The only thing all that should do is to check if there is a new tab called "NewData". if that's the case it should
1. delete old tab named "Data"
2. rename "NewData" tab to "Data" tab
3. define new name range (to be used in pivot table as a source)
4. refresh pivot table.


with all that i was able to export new data from access into the report in excel.

Looks all good so far, exept seems that the excel code got imbedded into the excel file. Seems like there is some code being excecuted before it ever gets to the auto_open module....

so if I put msgbox as my very first line in auto_open excel function, it will show me the message box exept all the data is already in place, without ever executing the code... I'll never see "NewData" tab, all the new data is in "Data" tab already!!!

How is that possible??? already spend hours doing the research with absolutely no luck.

I hope all that make sense.

I'll gladly send 2 sample files to show what happens (1 mdb file and 1 xls file).

Any help would be greatly appreciated.
Oct 11 '07 #1
1 2222
nico5038
3,080 Recognized Expert Specialist
Why not disable the auto_open code (or even remove it) entirely ?

Nic;o)
Oct 11 '07 #2

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

Similar topics

13
35559
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
2
2117
by: quadric | last post by:
Hi, I have an application that requires that Python initiate and mediate a live and iterative conversation between an external application (in which Python is embedded) and an external Excel spreadsheet. Python will have to pass info to the spreadsheet, spreadsheet will make calculations, Python will obtain results and pass back to application, application will evaluate results of spreadsheet calculations and create new set of data and
8
4883
by: Catherine Jo Morgan | last post by:
Some columns in the excel contact info spreadsheet correspond exactly with the new database fields. Three columns contain a mishmash of info that will need to be entered manually in the correct database fields. Maybe I could make a form to use for this, to use to hold and view the information from the three excel fields, as well as to copy and paste the info into the correct database field? Or is there a better way? I'm still designing...
6
4958
by: Duncan Smith | last post by:
Hello, I am currently implementing (mainly in Python) 'models' that come to me as Excel spreadsheets, with little additional information. I am expected to use these models in a web application. Some contain many worksheets and various macros. What I'd like to do is extract the data and business logic so that I can figure out exactly what these models actually do and code it up. An obvious (I think) idea is to generate an acyclic...
5
2853
by: barien75 | last post by:
Does anyone know if there is a way to specify the file to transfer from? The files I need are all named the same with one small difference. Each one has the days date at the end of the file name. This will be done on a daily basis to capture the previous days data into the table. The table also has 2 additional fields which the end user will add information to after it is imported. This is using Access 2000 importing from an Excell...
0
5091
by: mix01 | last post by:
Hi, I am trying to get some VBA code working, but am preplex as to why it does not work. I would really appreciate any level of help. Many thanks, Mix01 Version of the program
9
2812
by: HHung1977 | last post by:
Hello All - I currently have a database with a module that manipulates some data from Oracle and then writes the data into a table. I want to export the table to a web server, but when I use the Transfer Spreadsheet method I keep receiving a message stating, “Run-Time 3651 error Invalid Internet address” However, I know that the address is correct, any suggestions? DoCmd.TransferSpreadsheet acExport, 8, "FINAL_DAILY",...
8
9428
by: Perl Beginner | last post by:
I am using Win32. I have created an excel spreadsheet, formatted the columns and rows, and would like to write to the cells…all of this using Spreadsheet::WriteExcel. My issue is, my script is very vast with a lot of subroutines, but I need the excel spreadsheet created in the main subroutine becasue this is where the data is that i want to capture. So if I create and format the spreadsheet within the main subroutine, and as it loops through,...
0
2807
by: gjones | last post by:
I have an Oracle Forms application and I want to populate an Excel spreadsheet with some data from the application. I am using the DDE.Poke command to transfer data into the spredsheet and that is fine, but there are some merged cells on the spreadsheet that will not allow data to be transferred to using the DDE.Poke command, DDE.POKE(docid, 'R9C8',tmpdateperiod, DDE.CF_TEXT, 1000); Is there a way that I can populate merged cells in Excel...
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9235
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.