[AccessD] TrasnferSpreadsheet failing

Stuart McLachlan stuart at lexacorp.com.pg
Wed Mar 18 08:15:45 CDT 2009


Are you manipulating the spreadsheet in VBA?  An orphaned Excel instance is usually 
caused by not fully qualifying a reference somewhere.  

See http://support.microsoft.com/default.aspx?kbid=178510

<quote> When you write code to use an Excel object, method, or property, you should 
always precede the call with the appropriate object variable. If you do not, Visual Basic 
establishes its own reference to Excel. 
</quote>

The example given is: 
xlSheet.Range(Cells(1,1),Cells(10,2)).Value = "Hello" 
needs to be 
xlSheet.Range(xlSheet.Cells(1,1),xlSheet.Cells(10,2)).Value = "Hello"  

I got bitten by this one a couple of years ago and it took me a long time to track down.

-- 
Stuart

On 17 Mar 2009 at 15:29, Jennifer Gross wrote:

> I often times cannot get the ghost of Excel to end, so it requires a
> reboot.  One quirky thing I have found with exporting to Excel from
> Access is that if I do it over and over again and close the Excel mother
> ship each time then I will get an error and this ghost I cannot get rid
> of.  If I only close the spreadsheets themselves, leaving Excel open,
> then I all works fine.  Don't know what that's about, and probably not
> related to your issue.
> 
> Jennifer
> 





More information about the AccessD mailing list