Storage of excel file

T

thtsps

Hi,

I've customized a form and see a code as below
Sub cmdWorksheet_Click

Set objExcelApp = Item.Application.CreateObject("Excel.Application")
objExcelApp.Workbooks.Open("AAAA.xls")
Set objExcelBook = objExcelApp.ActiveWorkbook
Set objExcelSheets = objExcelBook.Worksheets
Set objExcelSheet = objExcelBook.Sheets(2)
objExcelSheet.Activate
objExcelApp.Application.Visible = True
End Sub

I got some problem that when other user click to get a excel file they will
get a error that "AAAA.xls could not be found" Pls let me know how do i do
about the storage of this file. Thank in advance
 
S

Sue Mosher [MVP-Outlook]

Your Workbooks.Open statement should include the full path to the worksheet file, not just the filename.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top