[AccessD] Open Exce to modify Workbook

Darryl Collins Darryl.Collins at iag.com.au
Mon May 24 18:22:50 CDT 2010


_______________________________________________________________________________________

Note: This e-mail is subject to the disclaimer contained at the bottom of this message.
_______________________________________________________________________________________



Agreed, I would also check if your permissions to access the file location where the Excel file is has changed. 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence
Sent: Tuesday, 25 May 2010 6:38 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Open Exce to modify Workbook

Given the error, it still does not sound like the network connection is
being made...

Jim



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Hewson
Sent: Monday, May 24, 2010 7:11 AM
To: AccessD
Subject: [AccessD] Open Exce to modify Workbook

Access 2007, Excel 2007, Win XP (32 bits)... I've used Windows 7 (64 bits)
same results.

I have a button on a form to export data to an Excel Workbook.
Because of the limitations of Access queries, I need to export to three
worksheets within the Workbook.
I use Transferspreadsheet to export the queries to the workbook.
I give the workbook a specific name and thus use a variable to be
consistent.

Exporting to Excel three times creates three worksheets within the same
workbook.
This works well...
But what I need to do is open the workbook that was just created, insert a
worksheet and then put the parameters of the export in specific cells.  I
then need to combine the other three worksheets into one and then format the
worksheets.

Everything was working fine for 3 or 4 months -- now it doesn't.

My work machine lost network connectivity and nothing that was done would
restore it.  
I do not have admin rights to the machine.  The "help" desk personnel stated
the hard drive was going bad and needed to be replaced.  They gave me a new
hard drive and installed Office on it. 

Now I cannot open Excel through Access.
I've checked references.  I scoured the internet to see if my code was
wrong.  But, I'm using the code that is recommended.  I could find nothing.

Error message:
OLE Automation Error 440, <Object variable or with With block variable not
set> Sometimes, I'll get... run-time error '-2147417851 (80010105)' Method
'Open' of object 'workbooks' failed.

The breakpoint is at:

With xlapp

	.Workbooks.Open strFileName

It doesn't go past that line.

Any suggestions?

MTIA
Jim


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________________________________________________

The information transmitted in this message and its attachments (if any) is intended 
only for the person or entity to which it is addressed.
The message may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in reliance 
upon this information, by persons or entities other than the intended recipient is 
prohibited.

If you have received this in error, please contact the sender and delete this e-mail 
and associated material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or distribute 
the information contained in this e-mail and any attached files, with the permission 
of the sender.

This message has been scanned for viruses.
_______________________________________________________________________________________




More information about the AccessD mailing list