I've asked about this before, but all the suggestions I've gotten have not solved the problem. Basically, I am formatting an excel spreadsheet from within Access and after I finish and save, I cannot open the spreadsheet in excel. I have tried: checking for instances of excel running, saving the workbook, closing the worksheet, closing the workbook.
Here's my code as it is now:
(All varibles are publicly defined within the module)
Set wks = GetObject("S:\DTC Recon Reports2\Recon " &
strCurrDte & "\DTC All Report.xls"
wks.Application.DisplayAlerts = False
Set objASht = wks.ActiveSheet
Set objPgSetup = objASht.PageSetup
wks.Parent.Visible = True
wks.Windows(1).Visible = True
'*{Format here, inserting lines, number formats, etc}
wks.Save
wks.Parent.Visible = False
wks.Windows(1).Visible = False
I have also tried running the code without visible = true stuff as well, but the formatting will not occur if I don't open the spreadsheet up to format.
Any suggestions?
Thanks.
MB
Here's my code as it is now:
(All varibles are publicly defined within the module)
Set wks = GetObject("S:\DTC Recon Reports2\Recon " &
strCurrDte & "\DTC All Report.xls"
wks.Application.DisplayAlerts = False
Set objASht = wks.ActiveSheet
Set objPgSetup = objASht.PageSetup
wks.Parent.Visible = True
wks.Windows(1).Visible = True
'*{Format here, inserting lines, number formats, etc}
wks.Save
wks.Parent.Visible = False
wks.Windows(1).Visible = False
I have also tried running the code without visible = true stuff as well, but the formatting will not occur if I don't open the spreadsheet up to format.
Any suggestions?
Thanks.
MB