J
Jonas
I am doing a project that starts out in Access and creates an Excel
workbook. While in the workbook excel does some formatting. I can't
figure out why I am getting the above error. Below is the line that
my program gets stuck at:
numcells = WorksheetFunction.CountA(xl.Selection)
It only gets stuck every other time that I run it. Below are some
possibly pertinent sections. Can anybody see what I am doing wrong?
Set xl = CreateObject("Excel.Application")
Set objectVarName = GetObject("c:\" & "Rene_" & Format(Date,
"mmddyyyy") & ".xls")
Set XlBook = GetObject("c:\" & "Rene_" & Format(Date, "mmddyyyy") &
".xls")
xl.Visible = True
XlBook.Windows(1).Visible = True
Set XlSheet = XlBook.Worksheets(1)
XlBook.Worksheets(1).Activate
rest of code here
xl.Quit
Set xl = Nothing
Set objectVarName = Nothing
Set XlBook = Nothing
workbook. While in the workbook excel does some formatting. I can't
figure out why I am getting the above error. Below is the line that
my program gets stuck at:
numcells = WorksheetFunction.CountA(xl.Selection)
It only gets stuck every other time that I run it. Below are some
possibly pertinent sections. Can anybody see what I am doing wrong?
Set xl = CreateObject("Excel.Application")
Set objectVarName = GetObject("c:\" & "Rene_" & Format(Date,
"mmddyyyy") & ".xls")
Set XlBook = GetObject("c:\" & "Rene_" & Format(Date, "mmddyyyy") &
".xls")
xl.Visible = True
XlBook.Windows(1).Visible = True
Set XlSheet = XlBook.Worksheets(1)
XlBook.Worksheets(1).Activate
rest of code here
xl.Quit
Set xl = Nothing
Set objectVarName = Nothing
Set XlBook = Nothing