Save Contents Of Clipboard
I have a spreadsheet where i need to disable Cut but allow copy & paste. This must stop dragging and dropping and only apply to the workbook in question, i.e. if I CTRL-TAB to another workbook cut is re-enabled. I have used the following code
Private Sub Workbook_Activate()
Private Sub Workbook_Deactivate()
Public Sub enableCut(enable As Boolean)
Dim cBar As CommandBar
Dim cbCtrl As Office.CommandBarControl
If enable Then
View Complete Thread with Replies
Related Forum Messages:
Copy Userform To Clipboard And Save As JPEG
I am on the final part of a visitor log and I am stumpped on how to finish it. I have a electronic signature pad (Interlink Electronics-ePad) that the controls will not allow me to use in VBA for excel, I can get the image and signature on my usersform but am unable to save just the image through any code.
All I have been able to come up with at this time is saving the userform and pasting it in the active worksheet (code for this I found here written by "Michel Pierron"). What I would like to be able to do is have the userform image cropped to where the "Image1" image is (Signature will be in it place when done, the OCX esign block will not show on upload) and then saved as "visitors name, date/time.JPEG" to a folder in my documents.
The attached file is a stripped down version of what i have so far with no checking involved, just trying to get the save part of this done. If all I can do is save the userform as a whole that would work also but would like to be able to change it to a jpeg for storage. Have tried to use epads SDK's to achieve a saved signature but haven't been able, was suppose to be on vacation this week but need to get this done before the 1st.
Save AS File Name As Cell Contents
I would like to be able to open a template and save the contents of cell B19 as the file name.
Can I do this so i don't have to press a button to run the macro. I have only done one macro previously and that was with the help of people on this forum so don't get to technical.
If possible I would like to be able to save it on the server X:
Copy Cell Contents To Different Worksheet On Save
I have an Excel invoice set up and working well. It does a bunch of things with macros - e.g. on save it increments the invoice number well as creates a jpeg screenshot for the invoice archives. I have added an additional worksheet (titled 'VAT') to the workbook. The new 'VAT' worksheet has five simple columns; Invoice no, Subtotal, VAT, M.O.T. and Total.
What I need:-
On saving the workbook I would like to add a macro function that copys the final contents of the Invoice no (H2), Subtotal (C37), VAT (C38), M.O.T. (F38) and Total (I38) cells from the 'Sales Invoice' worksheet to the newly created 'VAT' worksheet in the respective columns. I would like this to be cumulative, i.e. continue to add the contents of the afore mentioned cells to the appropriate columns in the 'VAT' worksheet every time the invoice is saved. I would also like to have the Subtotal, VAT, MOT and Total columns summed and outputted in a cell of their own - but hopefully I can handle that.
Can i put the value or range of the clipboard in a variable?
I have a macro that put the cutcopymode at false but i want to put the clipboard in a variable before putting the cutcopymode at false.
I am running into trouble with too much data accumulating on the clipboard in XL2007, so is there any way to set cutcopymode=false (or some other function) so that the clipboard is automatically cleared after every paste event throuout a macro project without having to restate cutcopymode=false after every paste?
Clear The Clipboard
I'm trying to clear the clicpboard using VBA so i don't get messages asking me what to do. is this possible and if so how? i could simply turn all alerts off but i rather not.
I'm currently opening up worksheets, copying the data there inside tables and pasting it over to a new worksheet which is basically the summary of all the data, unfortunately because I am moving large amounts of data, half way through the process I get a pop up asking me if I want to copy data to wherever to make sure it's stored or do I want to loose it, of course it's only a matter of hitting the no button to re-write the data so copy and paste carries on working but is there no function in VBA to clear the clipboard after every copy and paste, such as clipboard.clear, or something along those lines? Anything that will stop this message from appearing, I was my summary worksheet to work without popups appearing because then that would mean someone would have to sit there as it copies and pastes values, clicking no every time the clipboard gets full.
I am looping through and copying screens of mainframe data and appending them to the clipboard. Once done, I start a Notepad and paste it for future massaging. Now I need to perform a check on each screen which requires copying something from the screen, assigning to a variable, and checking it. This overwrites what I've already stored on the clipboard. Is there a way to store what I've got on the clipboard, then use the clipboard for something else, and then reload the clipboard?
Reading From Clipboard Before Pasting
Is it possible for VBA to read data from a clipboard so that it knows what sheet to paste the data to? Currently we run a financial tool and 2 reports are ran and I put in a bottom so users could easily just paste special values into the correct place. Sometimes the users forget if they copied the balance sheet data or income statement data and currently its not a big deal because there are no columns to the right of where it is pasting so it isn't screwing anything up and they just delete the data and paste it to the correct sheet.
I have thought of 2 approaches I am going to take, but started to wonder if one could read the data from the clipboard before the paste.
My 2 options would be:
Option 1. Paste data to newly created sheet and check if it is balance sheet or income statement and then move from newly created sheet to correct sheet and delete newly created sheet. The user wouldn't see any of this because I would disable screen updating.
Option 2. Learn how to use Undo within my VBA or keep the Undo cache with items in it as it typically clears when VBA is executed. That way if they paste it and it is wrong I can just undo the VBA paste.
Option 1 I am confident I can handle. Option 2 I can research and feel I could do, but if it comes a time when a sheet has data I do not want to paste over then this option is no good.
I would like to hear any comments or feedback on this and if it is possible to read data off the clipboard so it knows where to paste.
Turning Off The Clipboard Sound
I recently installed Office 2002 onto a new computer and found that whenever I drag-and-drop any amount of data from one cell to another, a loud obnoxious noise plays when I release the drag-and-drop data.
I was using the same version of Office on my old computer and did not have this problem.
I'm guessing it's a clipboard issue, since when I open the Excel clipboard (where I currently have all options as unchecked) and copy something so it is captured there, the same noise plays.
I already have turned off Windows sounds via the Control Panel and have no clue how to turn off this sound.
Clearing The Clipboard In Code
My workbook has much copy and past from one sheet to another after a web query, eventually it freezes.
I suspected all along it had something to do with the Copy/Paste and the clipboard required to be absoultely emptied.
The code I used to "clear the clipboard" is:
Declare Function CloseClipboard Lib "user32" () As Long
Declare Function EmptyClipboard Lib "user32" () As Long
Declare Function OpenClipboard Lib "user32" (ByVal Hwnd As Long) As Long
But when I checked out some freeware in relation to clipboard viewers etc, it seems after running this code it does not absolutely empty the clipboard.
How can I empty the clipboard entirely or am I not constructing my work correctly ?
Paste Clipboard On VbOKOnly
I need a snipit of code that will paste the clipboard when the OK button on a message box (vbOkOnly) is pushed. I have in the past was able to make it stop if "Cancel" was selected, but one button seems to be harder for me.
Cannot Empty/clear The Clipboard Error
I am using VBA in conjunction with an application called Quick Keys (basically software that allows you to program key strokes) ... and with this current project of mine ... I keep getting one of the following two errors:
"Cannot empty the clipboard" OR "Cannot clear the clipboard"
So I Googled, and based on the results it seems it is a VBA related error!
Paste Macro - Clipboard Validation
If the user clicks the button to do the paste special macro twice - the second time they get an error (I am assuming that the clipboard has been wiped clean and they need to go back and copy the data again). The specific error message is: "Run-time error '1004': PasteSpecial method of Range class failed".
What I would like to do is add code to the pastespecial macro that looks to see if there is something to paste - if not, I want to give my own message and not the default one.
Formula's Value Written To ClipBoard
I have a formula that will give me a phrase that I need to be able to paste into other applications - the value and not the "mid"s and the "search"s, etc. So, can anyone tell me how to take that formula's value and write it to the clipboard?
Getting Address Of Range Copied To Clipboard?
get the address of the last range copied to the clipboard? I tinkered with GetFromClipboard but I would like to find a solution that is not dependent upon DataObjects if possible. Since copied cells are "marqueed" in Excel, is there a property relating to marqueed cells address?
Worksheet Refresh Clears Clipboard
I have written a spreadsheet for scheduling employee shifts.
My problem is that I have written some calculations in on the Worksheet_Change subroutine.
What happens is when I want to copy a selection and paste it multiple times, it clears my active selection's "Copied" status whenever I paste.
I'm not sure if I'm explaining it clearly, but if I copy a selection (it turns the typical selected colors with the dashed border), go to the first destination, and paste, the spreadsheet then refreshes the total hours columns, which clears the "copied" status of the original range.
I was thinking of checking the clipboard contents to see if it contains an excel range, and putting it back in the clipboard after the spreadsheet updates.
I'd like to know how to check the clipboard contents, or if anyone else can think of a different way to circumvent this,
Close Workbook Without Clipboard Message
When processing workbooks via VBA, on closing the workbook I sometimes get a request to respond to whether I want to save the clipboard. In the same way that there is the option to open a workbook without refreshing links: workbooks.open updatelinks:=False
I assume there is something on the order of: workbook.close DontSaveClipboard:=True
Question #1 is: What is the parameter syntax for saving or not saving the clipboard?
Question #2 is: Where would I go to look up these parameter settings instead of having to come back to the group every time I find the next one I need?
Stop Data On Clipboard Message
I've just written a macro to copy large amount of data from one worksheet into another. It works well right now, except a little problem. Every time I run the macro, there is always a message box appeared. It let me to choose whether to save or delete data on the clipboard. And I usually choose 'no'. (The message box has been screenshotted and attached into this thread.) Because I use this macro very often, it really makes troubles to me. Is there anyway to block the message box. I mean let it never appear?
Copy/Cut Clipboard Being Cleared By Events
I have a legacy Excel VB application with multiple sheets. When the
users tab from sheetA to sheetB the paste buffer is cleared. This might
be due to the fact that sheetB has Worksheet_Activate processing that
does some validation and refreshes a pivot table (on sheetB).
Is there a way to reserve and restore the contents of the paste buffer,
and make sure the user can actually paste values from sheetA to sheetB
(using either Ctrl-V or Edit-Paste)?
Prevent Loss Of Copied Data On Clipboard
Using a macro I want to paste from the clip board.
I can manually do this by opening the clipboard, selecting the data, which pastes to my specified location.
The macro copies to the clipboard okay, but loses the data that I want to paste because just before pasting I have to clear data which was previously been filtered - I have to do this at this point. The macro bogs down. If I end the macro there, I can manually open the clip board and choose the data I copied from there and paste it that way. I'd like the macro to do this for me.
Copy Status Bar Stat To Clipboard
I want to create a macro that will copy the stat that is displayed in the status bar (bottom right corner - e.g. Sum, Count, Max, Min, etc.) into the clipboard in order to paste it to another workbook or worksheet. At present, I'm creating a formula on the active sheet and pasting the value to the detination sheet/workbook. Since I have to do this many times over, I'd prefer to have a macro to copy the value in the status bar to the clipboard, and simply pasting.
Stop Large Amount Of Data On Clipboard Message
I have some code to open up another workbook, take the data from sheet1 in it, copy it to a sheet in the first book, and then close the opened workbook. My problem is that whenever it closes the workbook it gives me the large amount of data on clipboard window that I must then click 'No' on before it will proceed. I thought that making CutCopyMode = False would fix that, but it hasnt worked. Heres the bit of code that does this:
CutCopyMode = False
Workbooks.Open Filename:= _
CutCopyMode = False
VBA To Copy Selected Cells To Clipboard With Text Data
Need aid in copying certain cells with text/labels to clipboard to format a body of email to be sent via Yahoo webmail, so I can paste it where needed.
I did a couple of Excel VBA's back in 2000 or so at last job but haven't seen/used VBA since.
Have a spreadsheet with customer data, (one cust per row) and wish to create something like the following in clipboard (in this example, assuming row 2 is the selected row)...I'll only be sending out one or two of these per day so nothing fancy is needed, just a way to avoid retyping critical data that could get mistyped.
Rental details for 2008
Customer Name : A2
Unit nbr : A3
Nbr of weeks : A4
Balance due : A5
I'm using Office 2000 still...I've done some searching but results found seem to complicated for my situation or not quite close enough for me to see how to apply it.
Customize Look In/Save In (My Places) In Open/Save As Dialog Boxes
I would like to add some icons on the left side of excel open file pane to faciliate my work. Because i need to load some files under the same folder many times a day. Does anybody know how to do that? I've seen people has more icons on the pane before. The defaut setting has only 'History', 'My Documents', 'Favorites', 'Desktop' and ' My nutwork places' on it.
Choose Sheets That Save Or Don't Save
I have 120 sheets in my workbook and I only need 5 of them to save when there are changes, the other 115 are were data is pulled from. Is it possible to tell excel not to look at a sheet when it saves? I'm just after making it save faster.
This is going to be a workbook that " moves" a round a lot, so I want to the 115 sheets in the same workbook.
Save As Macro :: Save File To Folder
I have a macro that copy one sheet of the Active workbook and sends it via email.
I need to add a code in this sheet so when one opens it from the email, with a command button to be able to save the file to specific, fixed folder on the local network with itís original file name.
Disable Save & Save As Buttons
I use to send reports to my seniors on daily basis.
I want these reports to be with me and they can just open and check the reports, when I send them. If they try to save file through File-Save or File-Save As, they should not get these options at all in the File Menu.
Save Back Up Copy Online At Each Save
I have a sheet which I would like to back up online every time it is saved.
I have a sub, OnlineFile(), which I have used many times without any problems, which creates a .BAT file to use ftp to upload files onto our server. As arguments, it takes the local file path that you want to upload (or download to), the name of the file as you would like it stored, the online file path, and whether you want to upload the file onto the server, or download it off the server.
It should be very easy to combine the two: what I tried was:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, cancel As Boolean)
ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "" & "Rubbish.xls"
Call OnlineFile(ThisWorkbook.Path & "" & "Rubbish.xls", "Rubbish.xls", "wwwrootexcelfilesMasters", "Upload")
Kill ThisWorkbook.Path & "" & "Rubbish.xls"
Every time I ran this, the file got uploaded correctly, but Excel had a series of problems. Often the code ran fine the first time it was run, but crashed the second time round.
After a fair bit of troubleshooting, I found that the problem came about when the file was trying to save itself - i.e. after the end of the sub. If you pause any macros from running, it still saved fine, but when the code ran, it found errors, froze or closed excel.
My thought at this point was that the code was fragmented or something. I made a new sheet, and retyped just the relevant bits of code (i.e. the BeforeSave sub, the OnlineFile sub and created the form called by OnlineFile). The problem persisted.
I've come up with a workaround for this now (which uses the same OnlineFile sub & form, and works fine), but it's driving me crazy - why does this cause excel to die? Particularly on the second time through? The code seems far too simple to cause such problems - is there a bug in Excel perhaps (I'm using Excel 2000 on Windows XP).
Find Cell, Copy Adjacent Cell Or Cells To Clipboard
Hereís what I want to do in VBA
1. Put a value in cell H1 (text and numbers)
2. Find a matching value in column A (starting in row 2), error message if the is not a match.
3. Copy the adjacent cell column B (rows vary) to the clip board. It would copy until it found the first blank row.
I have attached a scaled down version of the spreadsheet, the one I use has 100's of codes. I know some VBA but not much. I searched the forum but could not find anything.
Overwrite The Save/save As Feature
i have a master workbook. it gets used daily as a template and saved as another file name. the file name is generated by 5 cells that each contain different data (date, street, town, state). is it possible when i hit the save or save as button/icon, for a file name to be automatically generated from the cells i have data in??
PostPosted: Wed Oct 15, 2003 5:12 pm Post subject: Re: change default saveas name for new file w/o saving
Okay, so you want to create a workbook via code, prompt the user for a SaveAs name, then save this workbook?
Dim wb As Workbook
Dim SaveFileName As Variant
Set wb = Workbooks.Add
ChDir "C:VBA Code"
SaveFileName = Application.GetSaveAsFilename("It is a new file.xls", _
"Microsoft Excel Workbook (*.xls),*.xls")
On Error Resume Next
If SaveFileName False Then wb.SaveAs FileName:=SaveFileName........................
- Disable Save As And Define The Save Name
I have a file that I have created that the users will use as a master template to create data that I need. Once they have finished, I want the file to define what the filename should be when they click save.
At the same time, I want to disable "Save As..." as some users will just use that and then will use a file name that another macro (that I will use) won't recognise.
Macro To Save, Save As With Sequential Name
My spreadsheet has 32 worksheets, I've recorded a macro to do the job "save, save as with specific name", but what I want is, when save as, I wanted the file name increase in one number, and the date in a specific range "H8:J8" the date should be the next saturday.
here is part of the code.
on this example I want the file saved as "PrA4W05.xls", being the next week "PrA4W06.xls", and so on.
and on "H8:J8" the next saturday.
Capture "Save As" Pathname And Save Another File
I have an excel workbook that uses a .bmp file [a picture]. The master excel file and the .bmp file are in the same directory on the network. The excel file is "Read-Only", so the user would open it, customize it and save it on their own computer or somewhere else on the network.
They are only allowed to save it under "Save As". Once the user saves it, they would then be able to use their customized copy for future updates etc. The problem is that the .bmp file is missing from this new directory.
Is there a way to automatically save a copy of the .bmp file under the Directory specified by the user, so it's always available when the Excel workbook is opened? Or is there a way to attach the .bmp file to the excel file, so they are always saved together?
Want To Disable Save And Save As
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
a = MsgBox("Save Is Disabled", vbOKOnly)
If a = vbOK Then Cancel = True
How do I get out of this file with my changes? Don't laugh.
This what I ended up with:....
Disable Save / Save As
i tried all vba's here and on google to disable save / save as, but none of them work so i would like to know the other way , how to go with clearing the contents of cell, the moment someone clicks save / save as, with /without range by using beforesave event
Not Before Save, But After Save Command Possible
I know that there is a command called "Private Sub Workbook_BeforeSave"
but is it possible to execute a routine after some one has saved?
so that each time a user selecteded save it would adn then routine this routine immediately afterwards?
say the routine was Run "Test" how would you incorporate this line into the command?
Prevent Save Until Save As Used
I am trying to hide/grey SAVE option from the menu bar and reset menu back to normal after Save AS has been used.
I was able to do disable SAVE using the following code.
Application. CommandBars("worksheet menu bar").Controls("File").Controls(4).Visible = False
the SAVE icon on the Standard toolbar still exist. Is there any way I can disable it and also prevent CTRL. S being used.
Second part of the question.
Once I use Save as I would like menu to be reset back to normal.
Save As Macro (macro That Opens The Save As Window)
I'm trying to have a macro that opens the save as window, places the name in cell f5 and then allows you to save the workbook with cell f5 as the filename. I have managed to get the save as window to come up and the cell f5 as the name, but when I press save is doesn't. Here is what I have (also, is there a way to direct this to a specific folder).