ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   save userform as image (https://www.excelbanter.com/excel-programming/378829-re-save-userform-image.html)

Tom Ogilvy

save userform as image
 
Why not try it with a simple name and get it working - then you can expand
from there.

A subscript out of range would probably mean there is no sheet with the name
NameSSN. perhaps that is a variable and you really want

Worksheets(NameSSN) where previously you did something like NameSSN
= "Sheet1" as an example.
--
Regards,
Tom Ogilvy

"BigPig" wrote in message
...
Hi Tom,

Thanks for the code.

I tried it and it worked as you mentioned. At the bottom of the code I
included a statement to save the workbook as etc... but it didn't work.
(susbscript out of range)Do you have any ideas? Here is the code that I
put
at the bottom of what you sent:


ActiveWorkbook.SaveAs "C:\Documents and
Settings\myname\Desktop\OER_info_mail_out" & "\" & "OER Info " &
frmQV1.ComboBox1.Value & " " & Worksheets("NameSSN").Range("r1") & ".xls"
ActiveWorkbook.Close SaveChanges:=False

BTW Combobox1.value is a person's name and range("r1") is today's date
formatted as yymmdd.







BigPig

save userform as image
 
Hi Tom,

Thanks again for your advice. That's exactly what I did. I removed the
extra statements that referred to userforms and worksheets, and it worked.

After some trial and error, I ended up putting some hidden textboxes in my
userform, that included the information I needed to add to the file name.
Then after clicking on the 'Snapshot' commandbutton, it dumped that data into
the workbook added, and from there the code to write the file name worked.

Thank you.



All times are GMT +1. The time now is 02:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com