Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWrkbk = xlApp.Workbooks.Add
ii = 1
For i = 1 To 15 Step 2
xlWrkbk.Activesheet.Range("A" & i) = "Pre " & ii
ii = ii + 1
Next i
--
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"C Hayes" <(E-Mail Removed)> wrote in message
news:BA4BDBE3-3531-4F5D-9BAE-(E-Mail Removed)...
>I am trying to manipulate a new worksheet from Access. When running this
> code the first time the sheet is created and manipulated with no problem.
> If
> I attempt to rerun the code it fails.
>
> Run-time Error '1004':
> Method 'Range' of Object '_Global' failed
>
> any ideas as to my instancing the sheet? maybe the wrong method.
>
>
> Set xlApp = CreateObject("Excel.Application")
> xlApp.Visible = True
> Set xlWrkbk = xlApp.Workbooks.Add
> ii = 1
> For i = 1 To 15 Step 2
> Range("A" & i) = "Pre " & ii
> ii = ii + 1
> Next i
>
>
|