Double With Statement

K

Kaseano

I'm wondering if you can do a with statement, then another with statement
within that (to add onto the first with statement).



I have a problem with Excel VB not accepting Access VB (as described in a
post about 4 posts down), and i'm trying to find ways around it.
Here's the With code,



' Format Row 1

' For Each cell In xlSheet.Range("A1,"S1")
With xlSheet
For bytTemp = 1 To 30
With .Cells(bytTemp, 1)
.Font.Size = 10
.Font.Name = "Arial"
.Font.Bold = True
.Font.Color = conWhite
.Interior.Color = 0
.HorizontalAlignment = xlHAlignCenter
.WrapText = True
End With
Next bytTemp
.Rows(1).RowHeight = 25.5
End With
 
K

Klatuu

This is funny. I wrote that code.
It is in the SCCB report for NGIT Business Management. Tell Dawn I said
hello.
Are they no longer using the Access application?
That code has been running for about 2 years. What kind of errors are you
getting?
 
K

Kaseano

Yea i'm ripping off a 10 page Access to Excel code that you replied with
awhile back.
I couldn't get half of it to work though,
which is why I switched the
"for each cell in..."
to the For Loop... which I thought was all original but I guess not? =)

Anyway I have so many problems with the Access to Excel Code... Which are in
different posts.

I'm really curious about whether the double with thing works though?
I would test it out but I can't really come up with a simple way to test it
so I thought I'd just ask.

Thanks--
 
K

Kaseano

haha sorry what you said just clicked in my mind.

you gave me the code awhile back on a dif post.
I'm slowly trying to decode it + get it working.

I don't know how to reference specific posts, but it was in the
Import/Export Data Category-- and you can search "Kaseano", I only had one
post there.
 
K

Klatuu

Okay, I remember posting it now.
I have never used imbedded With statements, but I don't see any reason they
should not work. You just need to be sure you keep your references in line.

I don't know why you should be having so much trouble using automation. As
I said, that code has been running for over 2 years in productionn. If you
can give me a specific example of a problem you are having, including the
code, the error number, and the line on which the error occrus, I will be
happy to help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top