[AccessD] Excel Automation Problem - spreadsheet is hidden

Rocky Smolin rockysmolin at bchacc.com
Tue Apr 13 16:48:44 CDT 2010


I use Dim xlBook As Excel.Workbook (it's an existing workbook)

And set it thusly: Set xlBook = GetObject(Me.txtSpreadsheet) where
Me.txtSpreadsheet has the path and name of the workbook.

R

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo
Sent: Tuesday, April 13, 2010 1:23 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Excel Automation Problem - spreadsheet is hidden


Have you instatiated it ?

 Dim xlBook As NEW Excel.Workbook

Or

Dim xlBook As Excel.Workbook

Set xlbook as new excel.workbook

Just guessing?

Max


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Tuesday, April 13, 2010 9:18 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Excel Automation Problem - spreadsheet is hidden

Lambert:

Tried that first but it barfs on  xlBook.Visible = True where xlBook is
defined: Dim xlBook As Excel.Workbook

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert
Sent: Tuesday, April 13, 2010 12:54 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Excel Automation Problem - spreadsheet is hidden

Hmm. I took a closer look at that site and noticed that the coder has not
even declared the variable wkbNewBook, and the code is evidently written to
run in Excel VBA. 

However, in your code, assuming that xlBook is an Excel.WorkBook object, you
should be able to write this...

' close spreadsheet
    Set xlSheetProductionPlan = Nothing
    Set xlSheetBOMs = Nothing
    
    xlBook.Visible = True
    xlBook.Save
    xlBook.Close

    Set xlApp = Nothing
    Set xlBook = Nothing

MsgBox "Export Complete.", vbExclamation
 
End Sub 

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Tuesday, April 13, 2010 3:26 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Excel Automation Problem - spreadsheet is hidden

Lambert:

I get Object does not support this property or method on the .Visible = True

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert
Sent: Tuesday, April 13, 2010 11:44 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Excel Automation Problem - spreadsheet is hidden

This looks like a possible solution...

http://www.vbforums.com/archive/index.php/t-411430.html

Lambert 

--
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

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




More information about the AccessD mailing list