Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Automating Excel from Access 1

Status
Not open for further replies.

bdbBear

Programmer
Apr 29, 2005
54
US
I have some code that I'm using to automate Excel from Access.

After I run the code and close out Excel, it is still listed in the Processes window (in Task Manager).

I've identified the following line as causing this problem:

objxlbook.Sheets("Home").Range("A" & ROW_FIRST_SECURITY & ":" & CharLastCol & Me.lastRow).Sort key1:=Range(cLetter & ROW_FIRST_SECURITY), Order1:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False

I've identified it by running the code while commenting out various lines to see which ones are preventing Excel to be removed from the Processes list.

The line of code works and it's qualified just like the other lines of code I have.

I'm passing objXLBook using byref as type Excel.Workbook; this is similar to how I am doing it in all the sub routines in the program.

Anyone have any ideas?

Thanks!

- Bruce
 


Hi,

Might be nice to SEE the code that you are referring to.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
Replace this:
key1:=Range(
with this:
key1:=objxlbook.Sheets("Home").Range(

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

Thanks! You are right.

Glad I posted this question. Even though it was right in front of me I just didn't see it!

- Bruce
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top