473,796 Members | 2,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Excel stays in RAM after DoCmd.TransferS preadsheet

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 the problem, though.

I programmaticall y open a Microsoft Excel file from Access, do some
data checks etc., define a named range, perform
DoCmd.TransferS preadsheet, then delete the range, set all referenced
objects to Nothing, etc. However, Excel stays in memory.

There is other code that deals with Excel application too, and if I
comment out DoCmd.TransferS preadsheet the Excel is cleared from memory.

Is there something that TransferSpreads heet method needs after its call
to disconnect the tie between Access/Excel?

Thank you so much!

Nov 13 '05 #1
13 5973
I am totally guessing here, but I am thinking that you need to force a
relase of the MS Excel object. The issue is, I am not sure how it is
being set.

Set MSExcel = Nothing

You need to find out what the "MSExcel" above needs to be.

Then again, I could be totally wrong.

HTH

Nov 13 '05 #2
Here is where someone else is having the same issue.
http://www.utteraccess.com/forums/sh...8861&bodyprev=

Here is what was suggested.
set xlApp = nothing
I think I may have been right!

Nov 13 '05 #3
Thanks for the reply.

Actually I know that, and I am already doing it.

The release works for everything that I am doing with Excel, except
when I add that one line of DoCmd.TransferS preadsheet. Is there
something inside this method that ends up tied to Excel somehow?

Nov 13 '05 #4
are you opening Excel by default and not closing it and destroying all
references? Help others help you out - post your code! Otherwise this
is a bit like pin the tail on the donkey.

Nov 13 '05 #5
Br
aleksandra_83 wrote:
Thanks for the reply.

Actually I know that, and I am already doing it.

The release works for everything that I am doing with Excel, except
when I add that one line of DoCmd.TransferS preadsheet. Is there
something inside this method that ends up tied to Excel somehow?


Are you trying to run the Docmd.TransferS preadsheet while you have an
open reference to the Spreadsheet/Excel?
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #6
Please post the actual line of code that is causing problems.
"Br@dley" <br*****@usenet .com> wrote in message
news:JJ******** *********@news-server.bigpond. net.au...
aleksandra_83 wrote:
Thanks for the reply.

Actually I know that, and I am already doing it.

The release works for everything that I am doing with Excel, except
when I add that one line of DoCmd.TransferS preadsheet. Is there
something inside this method that ends up tied to Excel somehow?


Are you trying to run the Docmd.TransferS preadsheet while you have an open
reference to the Spreadsheet/Excel?
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response

Nov 13 '05 #7
I will post my code later. I cannot open it right now at this computer
for some reason. I apologize, but I did not get any notifications that
there were new messages, so I just thought noone's responded yet.

Anyway, as I've stated - ALL the references are destroyed, and the code
works perfectly (stepped through it step by step with uncommenting
blocks of code).

Bradely, I do not close the spreadsheet before the
DoCmd.TransferS preadsheet though. I close it after all the transfers
have been done (they are in the same workbook, but different
worksheets). Should I close the workbook before I use
DoCmd.TransferS preadsheet. This is definitely something I am not doing.
I am however destroying all references.

I will fetch the code tonight.

Thank you all

Nov 13 '05 #8
Hi Bradely,

yes I am trying to do exactly that. With open reference to Excel sheet.
Should I close it? And how far down the "closing" line do I need to go
- just the workbook, or the whole Excel?
I will get you do the code later.

Thanks!

Nov 13 '05 #9
On 4 Oct 2005 15:10:36 -0700, "aleksandra _83" <al************ *@gmail.com> wrote:
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 the problem, though.

I programmaticall y open a Microsoft Excel file from Access, do some
data checks etc., define a named range, perform
DoCmd.Transfer Spreadsheet, then delete the range, set all referenced
objects to Nothing, etc. However, Excel stays in memory.

There is other code that deals with Excel application too, and if I
comment out DoCmd.TransferS preadsheet the Excel is cleared from memory.

Is there something that TransferSpreads heet method needs after its call
to disconnect the tie between Access/Excel?

Thank you so much!


Hi
There is a long history of threads on this topic most of which end inconclusively.
It even happened to me!

David Fenton (who usually has the last word) suggests that all will be well
if you close everything AND always use late binding.

There are a number of KB articles which touch on this for A2k and maybe
other versions which don' t have all the service packs, so that is a good idea too.
Nov 13 '05 #10

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

Similar topics

2
1730
by: mcnewsxp | last post by:
how can i specify a particular worksheet using the docmd transferspreadsheet? thanks, mcnewsxp
3
11075
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 works perfectly fine, but when I change the table name argument (tblTest) to the name of a query, it fails and gives the following error:
4
48811
by: Tom Louchbaum | last post by:
I try to use this command to import a spreadsheet "DoCmd.TransferSpreadsheet acImport, 8, tablename & " -tbl", DIR & "Book2.xls", True" and it errors out. If I try to import that same spreadhseet with menu commands directly it works fine. The Docmd.transferspreadsheet command has always worked for me in the past, I will admit the excel file I'm importing is now slghtly different but I cannot figure out why the transfer does not work.
4
1711
by: Gregc. | last post by:
Hi I'm trying to download a query into excel and opening it up as a pivot table. Firstly, is this possible? This is my code thus far: Function Export() Dim excel As String excel = "CONSOLIDATION_XTRACT_TOTAL" DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, excel, "C:\Documents and Settings\GregoryCh\My Documents\Test.xls"
3
4536
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 name. Example: I have a Excelfile name is Inventory.xls,and sheet name is 'Raw Data',so i need Access data should export to Inventory Excel file Raw Data sheet. I tried like this:'DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,...
2
8016
by: amir369 | last post by:
Hi All, I'm trying to import an Excel sheet, but with more the one rang, couse the columns aint sequence. for example: DoCmd.TransferSpreadsheet acImport, , "DailyRprzntvRpt", _ Application.CurrentProject.Path & "\DailyRprzntvRpt.xls", True, "(A1:C18, F1:J18)" I'm getting an error, that saies that the range is not recognized by Access. Any idea?
5
8370
by: jerelp | last post by:
I have a form with one button the code for that button is On Error Resume Next DoCmd.TransferSpreadsheet acImport, 8, "FuelConsumption NewData", Me.tb_FileName, 1, "sheet2$" On Error Resume Next DoCmd.TransferSpreadsheet acImport, 8, "Inbound NewData", Me.tb_FileName, 1, "Inbound Trains$" DoCmd.TransferSpreadsheet acImport, 8, "Outbound NewData", Me.tb_FileName, 1, "Outbound Trains$" On Error Resume Next
4
3588
by: blammo04 | last post by:
My problem is that Access freezes up whenever I try to use the docmd.transferspreadsheet method, I can use the docmd.outputto and it works fine but I need to be able to use the transferspreadsheet method so I can have multiple queries in one excel file. If anyone can help as what the problem may be, I would greatly appreciate it. strReps = "SELECT Software., Software.Version, Software., " & _ "Software.Status, Software.,...
0
1679
by: Van Fitz | last post by:
I am importing an excel worksheet into an existing access 2000 table using TransferSpreadsheet. Im using a timestamp field as well in this table. This is going well, however, once the data is imported I need to find the last record imported and pull the value of a field called Code. Then add that value to another table where Code is the Key Value. This is all one continuous operation in the same sub and executing inline directly after ...
0
9680
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
9528
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
10173
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
10006
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
6788
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
5441
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...
1
4116
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 we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.