G
Guest
I use the following code within a module to open excel Spreadsheets as READ
ONLY to update an Access database
Set fs = CreateObject("Scripting.FileSystemObject")
Set fp = fs.GetFolder("\\Shared\Write-ups\")
Set ff = fp.files
fil_2_use = GetOpenFile(fp, "RAF List") (This Function is code originally
written by Ken Getz. It allows user to select file to be read)
If IsNull(fil_2_use) Or fil_2_use = "" Then Exit Sub
Set f = fs.GetFile(fil_2_use)
With xcl.Application
.Workbooks.Open fil_2_use, UpdateLinks:=False, ReadOnly:=True
Set wrkbk = xcl.ActiveWorkbook
.......
Here is Code to Read Worksheets......
wrkbk.Saved = True
wrkbk.Close
But the sub stops with dialog box "Do you want to save changes to ..."
No changes are made to the spreadsheets, but I do unhide a sheet (If I don't
I get a subscript out of range error when I try to read from it). There are
no Before Close events in the spreadsheets, and we have ensured no one else
had the spreadsheet open during our saves.
I cannot find the answer on the KB.
Why is it asking me to save changes when i've opened it as read only and
added the wrkbk.saved = true before closing
ONLY to update an Access database
Set fs = CreateObject("Scripting.FileSystemObject")
Set fp = fs.GetFolder("\\Shared\Write-ups\")
Set ff = fp.files
fil_2_use = GetOpenFile(fp, "RAF List") (This Function is code originally
written by Ken Getz. It allows user to select file to be read)
If IsNull(fil_2_use) Or fil_2_use = "" Then Exit Sub
Set f = fs.GetFile(fil_2_use)
With xcl.Application
.Workbooks.Open fil_2_use, UpdateLinks:=False, ReadOnly:=True
Set wrkbk = xcl.ActiveWorkbook
.......
Here is Code to Read Worksheets......
wrkbk.Saved = True
wrkbk.Close
But the sub stops with dialog box "Do you want to save changes to ..."
No changes are made to the spreadsheets, but I do unhide a sheet (If I don't
I get a subscript out of range error when I try to read from it). There are
no Before Close events in the spreadsheets, and we have ensured no one else
had the spreadsheet open during our saves.
I cannot find the answer on the KB.
Why is it asking me to save changes when i've opened it as read only and
added the wrkbk.saved = true before closing