Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VB error

Status
Not open for further replies.

bulkmail

MIS
Jun 11, 2002
345
US
When trying to open multiple documents in Excel I see this error:

Microsoft Visual Basic
Run-time error '1004'

This is executed by pressing the combination of 'ctrl + c'.

Any ideas?

Thanks,

BM
 
Hi,

There's a macro executed by ctl+C

when you get the error window, select Debug and tell me what you see.

You might copy the code and paste it in the reply window. :)

Skip,
Skip@TheOfficeExperts.com
 
Thanks, here is what i have. This is off a shared drive. It seems to be only affecting one user. Everyone else is fine. FYI, i change the path names and file names for this post but it is essentially just like this.

Sub combine()
'
' combine Macro
' Macro recorded 6/9/2003 by CC
'
' Keyboard Shortcut: Ctrl+c
'
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\10-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\11-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\12-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\13-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\14-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\15-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\16-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\18-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\19-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\20-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\21-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\22-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\25-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\003 OTB - Ret\26-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\27-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\30-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\31-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\32-03.xls", UpdateLinks _
:=3
Workbooks.Open Filename:= _
"I:\Rt\Red\03 OTB - Ret\35-03.xls", UpdateLinks _
:=3


End Sub
 
Forgot to mention that this started happening after I updated the users office 2000 with SP3
 
Nevermind. The drive was not mapped on the client computer.

BM
 
RUN-TIME ERROR '1004'; Method 'SaveAs' of object '_Workbook' failed

We will be doing parallel integrity testing for a new system for several months and I'm trying to make it easier by programmatically generating a text file from an excel spreadsheet which is shared. My understanding is that you may run code from a shared spreadsheet, but some options are disallowed. I did not believe 'SaveAs' to be one of them, but...

I do not have the problem when the workbook is not shared, and since I can't step through the code (in shared mode) to determine exactly where it's failing, I am assuming it is here when I try to output the file:

OutputFileName = "253DLAB" & DateFormat & ".pay"
CompleteFile = Directory & "\" & OutputFileName
Worksheets("PAY_OutputFile").Activate
ActiveWorkbook.SaveAs FileName:=CompleteFile, _
FileFormat:=xlTextPrinter

Any ideas? Want to see more?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top