DIVINEDAR0956
IS-IT--Management
Dear Heros,
I have the following procedure to open an excel file and it is suppose to update the links in access:
Private Function OpenEditExcelFile()
Dim XLApp As Object
Dim xlWB As Object
Set XLApp = CreateObject("Excel.Application"
XLApp.AskToUpdateLinks = False
XLApp.DisplayAlerts = False
Set xlWB = XLApp.Workbooks.Open("C:\COST\P0033.xls", False)
xlWB.Sheets("Sheet1"
.Select
XLApp.Visible = True
xlWB.Saved = True
XLApp.AskToUpdateLinks = True
XLApp.DisplayAlerts = True
Set XLApp = Nothing
End Function
I have three questions.
1. I can tell that when the excel file is opened from access it seems to want to update the links. Why is it that in my linked tables the error #Num! appears in almost every column?
2. In this line of the procedure (Set xlWB = XLApp.Workbooks.Open("C:\COST\P0033.xls", False) I would like for the open file name to be generic. In other words I would like to have it open the directory C:\Cost and pick an excel file to open automatically link the worksheet within the file to the proper table within access.
3. How does "AskToUpdateLinks" actually work when opening a file with links.
Any help at all would be appreciated. Thank you. Darlene Sippio
dsippio@comtechsystems.com
I have the following procedure to open an excel file and it is suppose to update the links in access:
Private Function OpenEditExcelFile()
Dim XLApp As Object
Dim xlWB As Object
Set XLApp = CreateObject("Excel.Application"
XLApp.AskToUpdateLinks = False
XLApp.DisplayAlerts = False
Set xlWB = XLApp.Workbooks.Open("C:\COST\P0033.xls", False)
xlWB.Sheets("Sheet1"
XLApp.Visible = True
xlWB.Saved = True
XLApp.AskToUpdateLinks = True
XLApp.DisplayAlerts = True
Set XLApp = Nothing
End Function
I have three questions.
1. I can tell that when the excel file is opened from access it seems to want to update the links. Why is it that in my linked tables the error #Num! appears in almost every column?
2. In this line of the procedure (Set xlWB = XLApp.Workbooks.Open("C:\COST\P0033.xls", False) I would like for the open file name to be generic. In other words I would like to have it open the directory C:\Cost and pick an excel file to open automatically link the worksheet within the file to the proper table within access.
3. How does "AskToUpdateLinks" actually work when opening a file with links.
Any help at all would be appreciated. Thank you. Darlene Sippio
dsippio@comtechsystems.com