Open Excel Workbook from Excel and Access 2003-2010

LORDMARKS

New Member
Joined
Jun 5, 2014
Messages
39
Hi All

I have been trying various codes to open a selection of one Page workbooks (Graphs) from Both Access and other Workbooks. Access is being used mainly as login and navigation to reports.

The below code is the best I have so far, but when opening form Access 2003 , I still get password prompt?

I have also attached the Open/Close code I am using in the workbook itself.

Thanks as always

Code:
Sub OpenXL2()
On Error GoTo E
Dim xlApp As Object
Dim Location As String
Location = "P:\NMUK Data\Snags Data\Line 1 and Line 2 New PLM\TPM DATABASE\1. Reports\TEST.xlsm"
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Open "P:\NMUK Data\Snags Data\Line 1 and Line 2 New PLM\TPM DATABASE\1. Reports\TEST.xlsm", True, False, Password:="1978"
Set xlApp = Nothing
Exit Sub
E: MsgBox ("This File has moved. Last loaction was  " & Location)
End Sub


Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayFullScreen = False
Me.Save
End Sub

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.WindowState = xlMaximized
SetAllScrollAreas
ActiveWindow.DisplayHeadings = False
ActiveWindow.DisplayWorkbookTabs = False
ActiveWindow.DisplayHorizontalScrollBar = False
ActiveWindow.DisplayVerticalScrollBar = False
Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Visible = False
End Sub
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top