LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Object Variable Not Set Error on Selection object

Hi,

I am export some MS ACCESS 2003 Query records onto an Excel Spread Sheet.
One section of the code is select a range of cells and move the these cells
by the columns into another location. I am using "SELECTION". Please see
below codes. The problem is I can only run the module (written in MS ACCESS)
once without error. After the 1st time, I closed the Excel spreadsheet
(genereated by the 1st run), call the module again, I would run into this
error when it hit the "Selection" object. It would error at
"Selection.Clear". But if I closed MS ACCESS and restart, I can run the
report without error.

Error: Object Variable Not Set or With Object Variable Not Set

================================================== ================
Set rngCurr = wksNew.Range(wksNew.Cells(6, 9), _
wksNew.Cells(7 + rstProjects.RecordCount,
rstProjects.Fields.Count - 2))

'wksNew.Columns(sColRange).Cut
'wksNew.Columns("I:L").Cut
'rngCurr.Columns.Select
Selection.Clear
rngCurr.Select
Selection.EntireColumn.Select
appExcel.CutCopyMode = False
Selection.Cut

'ActiveWindow.LargeScroll ToRight:=-2
Columns("C:C").Select
Selection.Insert Shift:=xlToRight
Set rngCurr = Nothing

================================================== ===============

Please help...

Thanks

Jean


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aling multiple sets of data by header column MarkusO Excel Discussion (Misc queries) 2 April 12th 06 07:29 PM
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
How do I include an all tab in a pivot variable selection Userx Excel Discussion (Misc queries) 1 September 26th 05 01:03 PM
object variable or with block variable not set Diego Excel Discussion (Misc queries) 1 August 9th 05 02:46 PM
Macro - Data Sort -Variable Selection Frantic Excel-er Excel Discussion (Misc queries) 3 June 6th 05 10:33 PM


All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"