Microsoft KB Archive/188033

= XL98: Recorded Macro to Open Workbook on Web Fails When Rerun =

Article ID: 188033

Article Last Modified on 9/11/2002

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q188033



SYMPTOMS
When you run a recorded macro in which you open a workbook from a Web server, you may receive an error similar to the following:

Run-time error '1004':

'MSO8AAB19B27E2' could not be found. Check the spelling of the file name, and verify that the file location is correct.

If you are trying to open the file from your list of most recently used files on the File menu, make sure that the file has not been renamed, moved, or deleted.



CAUSE
You may receive the above error because the recorded macro includes a line similar to the following: Workbooks.Open FileName:="hard drive:Temporary Items:MSO8AAB19B27E2" The file in this example, MSO8AAB19B27E2, is a temporary file and may not exist on your computer.



RESOLUTION
To prevent the error when you run your recorded macro, delete the line containing the code listed in the "Cause" section from the macro.



MORE INFORMATION
When you record a macro in which you open a Microsoft Excel 98 Macintosh Edition workbook from a Web server, the recorded code may be similar to the following: Sub Macro1

ActiveWorkbook.FollowHyperlink Address:="http://server/web/filename", _ NewWindow:=False, AddHistory:=True Workbooks.Open FileName:="hard drive:Temporary Items:MSO8AAB19B27E2" ActiveWindow.Visible = False Windows("http://server/web/filename").Visible = True

End Sub Note the line containing the Open method for the Workbook object. This line of code is not necessary because the FollowHyperlink method displays a cached document or downloads the target document and then opens it in Excel. There is no need to open the temporary file because the workbook from the Web server is already open in Excel.

