Controlling Excel from VBA after Output to Excel File 
Author Message
 Controlling Excel from VBA after Output to Excel File

Hi,

I'm trying to export a query to excel, then create a pivot table in
excel based on that query with vba.

I export to excel using "DoCmd.RunCommand (acCmdOutputToExcel)"
and then use the normal excel VBA to create the pivot tables (this
works in Excel). I do have the excel ref included in Access.

I get the run time error 91 [object variable or with block variable not
set]

Any Ideas?

Appreciate your time

Glenn Kobes

713-853-4798

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sun, 09 Mar 2003 03:00:00 GMT  
 Controlling Excel from VBA after Output to Excel File
I figured it out. I needed to used GETOBJECT to set the excel instance.
Then the macro language works.

grk


Quote:

> Hi,

> I'm trying to export a query to excel, then create a pivot table in
> excel based on that query with vba.

> I export to excel using "DoCmd.RunCommand (acCmdOutputToExcel)"
> and then use the normal excel VBA to create the pivot tables (this
> works in Excel). I do have the excel ref included in Access.

> I get the run time error 91 [object variable or with block variable
not
> set]

> Any Ideas?

> Appreciate your time

> Glenn Kobes

> 713-853-4798

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Fri, 21 Mar 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Excel - VBA - Retreive file without opening them in Excel

2. Windows EXCEL VBA / MAC EXCEL VBA compatibility issues

3. Excel 97 VBA vs Excel 2000 VBA

4. Simple VBA search and output ((EXCEL))

5. VBA Output Directly to MICROSTATION from EXCEL

6. Running excel add-in (added into excel - not access) in Access VBA

7. Outlook VBA - open Excel, read in two fields, send email with these, close excel

8. Compatibility Problem Using MS Excel 97 VBA on Excel 2000/XP - Causes crashes

9. VBA code in Excel 97 vs Excel 2002

10. vba script in excel to perform manipulations in excel

11. VBA in Excel, about two XLA in Excel

12. Help Excel 1997 to Excel 2000 VBA references

 

 
Powered by phpBB® Forum Software