SpaaamCatcher
Technical User
Hi, there. I need to find a way to run code from a shared workbook whereby one of the spreadsheets is saved off in text format. 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 realize that I can grant exclusive access at the time in order to do this, but then the workbook gets saved as unshared, which is a problem.
Any ideas why this code won't work while the workbook is shared, or a way around it? Help!
RUN-TIME ERROR '1004'; Method 'SaveAs' of object '_Workbook' failed
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?
I realize that I can grant exclusive access at the time in order to do this, but then the workbook gets saved as unshared, which is a problem.
Any ideas why this code won't work while the workbook is shared, or a way around it? Help!
RUN-TIME ERROR '1004'; Method 'SaveAs' of object '_Workbook' failed
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"
ActiveWorkbook.SaveAs FileName:=CompleteFile, _
FileFormat:=xlTextPrinter
Any ideas? Want to see more?