Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Almost there

I got help from the group last night in how to give the file a dynamic
file name using a macro, I was given the following VB CODE:

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value &
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Now the problem that I am having is more basic, when I try and run this
macro, I get the error message:

Compile Error: Expected End With

I am missing something basic here, what is it?

Thanks,

Richard

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Almost there

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value &
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
End With
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ups.com...
I got help from the group last night in how to give the file a dynamic
file name using a macro, I was given the following VB CODE:

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value &
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Now the problem that I am having is more basic, when I try and run this
macro, I get the error message:

Compile Error: Expected End With

I am missing something basic here, what is it?

Thanks,

Richard



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Almost there

Yes, not reading the error message.
It tells you are missing an "End With" before the "End Sub".

NickHK

wrote in message
ups.com...
I got help from the group last night in how to give the file a dynamic
file name using a macro, I was given the following VB CODE:

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value &
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Now the problem that I am having is more basic, when I try and run this
macro, I get the error message:

Compile Error: Expected End With

I am missing something basic here, what is it?

Thanks,

Richard



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Almost there

It works wondefully, thank you all so much, you have saved me HOURS of
work.

If you anyone can recommed a good VB book, I am open to suggestions, I
am at a new job, I currently work with SQL a lot, however this I am
seeing the need to do more and more with VB and Excel, while these
boards are a great source of knowledge, I would like to increase my own
known personal knowledge base.

Thank you all again.

Richard

NickHK wrote:
Yes, not reading the error message.
It tells you are missing an "End With" before the "End Sub".

NickHK

wrote in message
ups.com...
I got help from the group last night in how to give the file a dynamic
file name using a macro, I was given the following VB CODE:

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value &
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Now the problem that I am having is more basic, when I try and run this
macro, I get the error message:

Compile Error: Expected End With

I am missing something basic here, what is it?

Thanks,

Richard


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default Almost there

Your response seems a bit harsh. Remember not all participants have the same
knowledge as you or I. We're here to be helpful.
--
Best wishes,

Jim


"NickHK" wrote:

Yes, not reading the error message.
It tells you are missing an "End With" before the "End Sub".

NickHK

wrote in message
ups.com...
I got help from the group last night in how to give the file a dynamic
file name using a macro, I was given the following VB CODE:

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value &
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Now the problem that I am having is more basic, when I try and run this
macro, I get the error message:

Compile Error: Expected End With

I am missing something basic here, what is it?

Thanks,

Richard






  #6   Report Post  
Posted to microsoft.public.excel.programming
DS DS is offline
external usenet poster
 
Posts: 117
Default Almost there

Eyeman - I'd recommend pretty much anything by John Walkenbach, especially
the "Bible" series (there's versions for each release of excel). They've been
an immense help to me as I've been learning how to use excel and VBA. You can
get them through most decent bookshops.

HTH
DS

" wrote:

It works wondefully, thank you all so much, you have saved me HOURS of
work.

If you anyone can recommed a good VB book, I am open to suggestions, I
am at a new job, I currently work with SQL a lot, however this I am
seeing the need to do more and more with VB and Excel, while these
boards are a great source of knowledge, I would like to increase my own
known personal knowledge base.

Thank you all again.

Richard

NickHK wrote:
Yes, not reading the error message.
It tells you are missing an "End With" before the "End Sub".

NickHK

wrote in message
ups.com...
I got help from the group last night in how to give the file a dynamic
file name using a macro, I was given the following VB CODE:

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value &
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Now the problem that I am having is more basic, when I try and run this
macro, I get the error message:

Compile Error: Expected End With

I am missing something basic here, what is it?

Thanks,

Richard



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Almost there

Dunno, made me smile, and the OP didn't seem to take offence.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jim Jackson" wrote in message
...
Your response seems a bit harsh. Remember not all participants have the

same
knowledge as you or I. We're here to be helpful.
--
Best wishes,

Jim


"NickHK" wrote:

Yes, not reading the error message.
It tells you are missing an "End With" before the "End Sub".

NickHK

wrote in message
ups.com...
I got help from the group last night in how to give the file a dynamic
file name using a macro, I was given the following VB CODE:

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value &
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Now the problem that I am having is more basic, when I try and run

this
macro, I get the error message:

Compile Error: Expected End With

I am missing something basic here, what is it?

Thanks,

Richard






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default Almost there

Maybe I hadn't had enough coffee yet to be rational. My apologies.
--
Best wishes,

Jim


"Bob Phillips" wrote:

Dunno, made me smile, and the OP didn't seem to take offence.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jim Jackson" wrote in message
...
Your response seems a bit harsh. Remember not all participants have the

same
knowledge as you or I. We're here to be helpful.
--
Best wishes,

Jim


"NickHK" wrote:

Yes, not reading the error message.
It tells you are missing an "End With" before the "End Sub".

NickHK

wrote in message
ups.com...
I got help from the group last night in how to give the file a dynamic
file name using a macro, I was given the following VB CODE:

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value &
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Now the problem that I am having is more basic, when I try and run

this
macro, I get the error message:

Compile Error: Expected End With

I am missing something basic here, what is it?

Thanks,

Richard







  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Almost there

It wasn't meant to be too mean, but the OP did ask "I am missing something
basic here, what is it?".
The answer, I felt, was Yes.

NickHK

"Bob Phillips" bl...
Dunno, made me smile, and the OP didn't seem to take offence.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jim Jackson" wrote in message
...
Your response seems a bit harsh. Remember not all participants have the

same
knowledge as you or I. We're here to be helpful.
--
Best wishes,

Jim


"NickHK" wrote:

Yes, not reading the error message.
It tells you are missing an "End With" before the "End Sub".

NickHK

wrote in message
ups.com...
I got help from the group last night in how to give the file a
dynamic
file name using a macro, I was given the following VB CODE:

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value
&
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Now the problem that I am having is more basic, when I try and run

this
macro, I get the error message:

Compile Error: Expected End With

I am missing something basic here, what is it?

Thanks,

Richard








  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Almost there

For the record, I didn't take offense, I got the answer that I needed,
I have saved HOURS of work as a result, thank you all for your help.
NickHK wrote:
It wasn't meant to be too mean, but the OP did ask "I am missing something
basic here, what is it?".
The answer, I felt, was Yes.

NickHK

"Bob Phillips" bl...
Dunno, made me smile, and the OP didn't seem to take offence.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jim Jackson" wrote in message
...
Your response seems a bit harsh. Remember not all participants have the

same
knowledge as you or I. We're here to be helpful.
--
Best wishes,

Jim


"NickHK" wrote:

Yes, not reading the error message.
It tells you are missing an "End With" before the "End Sub".

NickHK

wrote in message
ups.com...
I got help from the group last night in how to give the file a
dynamic
file name using a macro, I was given the following VB CODE:

Sub test()

Dim Path As String

Path = "C:\Documents and Settings\Richard Sabbara\Desktop\"

With ActiveWorkbook
.SaveAs Filename:=Path & .Worksheets("Sheet1").Range("C1").Value
&
".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

End Sub


Now the problem that I am having is more basic, when I try and run

this
macro, I get the error message:

Compile Error: Expected End With

I am missing something basic here, what is it?

Thanks,

Richard







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"