Thom
05-30-2008, 08:52 AM
Hi all
The project I was working on was working just fine. THen I changed a couple of things which didn't work so reverted back to a different saved working version.
"Object variable or With block variable not set"
The error is at the line in red:
XLSheet.Cells.Select
With Selection.Font
.Name = "Verdana"
.FontStyle = "Norm?l"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
All the code is pretty long so I dont want to post it all. But essentially, i press a button in Access and it opens Excel, creates a few blank sheets and then selects all the cells. That bit works, it selects all the cells. Now, like I said before (and I am not lying :bug:) the code worked before. it's basically applying any formatting and it errors.
Any thoughts?
Thanks
Thom
The project I was working on was working just fine. THen I changed a couple of things which didn't work so reverted back to a different saved working version.
"Object variable or With block variable not set"
The error is at the line in red:
XLSheet.Cells.Select
With Selection.Font
.Name = "Verdana"
.FontStyle = "Norm?l"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
All the code is pretty long so I dont want to post it all. But essentially, i press a button in Access and it opens Excel, creates a few blank sheets and then selects all the cells. That bit works, it selects all the cells. Now, like I said before (and I am not lying :bug:) the code worked before. it's basically applying any formatting and it errors.
Any thoughts?
Thanks
Thom