Where is web page opened via VBA macro stored on C: drive?
Where is web page opened via VBA macro stored on C: drive?
(OP)
I am running this code in Excel VBA:
which opens this page as a read-only file. Where is this file stored on my C: drive? I have looked in C:\Users\Default\AppData\Local\Microsoft\Windows\Temporary Internet Files and it is empty. I have also looked in Libraries\Documents, where the MS Excel file is saved, and I did not find it there either. I also have looked in C:\Program Files (x86)\Microsoft Office\Office12 and I still did not find anything.
Where is this file stored?
CODE
Sub marco1()
Application.Workbooks.Open "http://www.eng-tips.com"
End Sub
Application.Workbooks.Open "http://www.eng-tips.com"
End Sub
which opens this page as a read-only file. Where is this file stored on my C: drive? I have looked in C:\Users\Default\AppData\Local\Microsoft\Windows\Temporary Internet Files and it is empty. I have also looked in Libraries\Documents, where the MS Excel file is saved, and I did not find it there either. I also have looked in C:\Program Files (x86)\Microsoft Office\Office12 and I still did not find anything.
Where is this file stored?





RE: Where is web page opened via VBA macro stored on C: drive?
That's not surprising, since Workbooks.Open is supposed to open a WORKBOOK. It's not saved anywhere until you do a SaveAs.
TTFN

FAQ731-376: Eng-Tips.com Forum Policies
RE: Where is web page opened via VBA macro stored on C: drive?
RE: Where is web page opened via VBA macro stored on C: drive?
My concern is in this section of code:
CODE
On Error GoTo internet_access_required:
Application.Workbooks.Open (Web_Page)
On Error GoTo not_authorized:
Cells.Find(What:=authorization_key_word, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
True, SearchFormat:=False).Activate
'close Web_Page
Application.ActiveWorkbook.Close savechanges:=False
Application.DisplayAlerts = True
Exit Sub
Sometimes the page opens slowly. Is it possible for the user to find that instance of the web page on the C: drive? Is it possible that the user interrupts the macro prior to running:
CODE
Application.ActiveWorkbook.Close savechanges:=False
I know that Excel has an auto-save feature. Where is the location of the file that is automatically saved?
This is the complete code. Web_Page, authorization_key_word, WBook_Password and Sheet_Password are strings defined elsewhere in VBA. The webpage is a blog that only I can access.
CODE
Application.DisplayAlerts = False
'OPEN INTERNET WINDOW AND REVIEW AUTHORIZATION
On Error GoTo internet_access_required:
Application.Workbooks.Open (Web_Page)
On Error GoTo not_authorized:
Cells.Find(What:=authorization_key_word, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
True, SearchFormat:=False).Activate
'close Web_Page
Application.ActiveWorkbook.Close savechanges:=False
Application.DisplayAlerts = True
Exit Sub
'===============
'goto NOT AUTHORIZED
not_authorized:
'delete all sheets
ActiveWorkbook.Unprotect Password:=WBook_Password
Sheets.Add Before:=Sheets(1)
While Sheets.Count > 1
Sheets(Sheets.Count).Visible = True
Sheets(Sheets.Count).Unprotect Password:=Sheet_Password
Sheets(Sheets.Count).Select
ActiveWindow.SelectedSheets.Delete
Wend
Sheets(1).Protect Password:=Sheet_Password
ActiveWorkbook.Protect Password:=WBook_Password
'save and close this workbook
Application.ActiveWorkbook.Save
MsgBox prompt:="Use not authorized." _
& " This application will now close.", _
Buttons:=vbCritical, _
Title:=verification_title
Application.ActiveWorkbook.Close
Application.DisplayAlerts = True
Exit Sub
'===============
'goto Internet access required to run this program
internet_access_required:
MsgBox prompt:="Internet access is required to run this program." _
& " This application will now close.", _
Buttons:=vbCritical, _
Title:=verification_title
'close this workbook
Application.ActiveWorkbook.Close savechanges:=False
Application.DisplayAlerts = True
Exit Sub
End Sub
RE: Where is web page opened via VBA macro stored on C: drive?
The Autosave goes to whatever folder is the default, unless current directory is changed by the user during the time Excel is opened.
TTFN

FAQ731-376: Eng-Tips.com Forum Policies