Macro or vba to control zoom of excel workbook
Hi
all workbooks when executed zooms out to 100% automatically
how do i write vba code or macro to control this zoom to 75%
where do i write it
also i save workbooks with zoom 75% on bw server, still upon execution or refresh it zooms out to 100%
referring other posts but no help
thnx
gurus !!!!!!!
Edited by: kartikey on Jun 10, 2009 12:38 PM
Hi Kartikey,
Please try this way,
Run your Bex query first, When you get the data then follow the below steps,
Right click on 'sheet1' ---> select 'View Code'
Here you will get SAPBEX(sapbex.xla) which is password protected , forget it
another one is VBAProject, under this project Double click on Sheet1(SAPBEXQueries)
and paster below given code
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveWindow.Zoom = 75
End Sub
now this will set your worksheet zoom to 75% , if you refresh your query , this will be remain same,
Please let me know if this is helpful for you
Cheers
Sukhi
9717080615
Edited by: Sukhvidner Singh on Jun 11, 2009 1:01 PM
Similar Messages
-
Problem with controlling Annotations from Excel VBA
Hi,
I have a PDF document that has plenty of sticky notes attached to it. These sticky notes have been added by multiple authors on all pages of the document. I am trying to import the contents of these sticky notes, their author and the page number to an excel spreadsheet. I am using Excel 2007 and Acrobat Professional 9.0.
This is the code that I am currently using to import the sticky notes, but the problem that I am facing is that when I run the macro -
Same sticky note contents, author and page numbers are imported multiple times
Not all sticky notes are imported, only some of them appear in the final excel spreadsheet
When I compare the number of sticky notes to that in the original PDF file, the number is correct. But the content is repeated content and that is the reason why only some of the sticky notes are imported.
This is an activity that I need to do on regular basis and the number of sticky notes that I need to import to excel may range between 100 to 200. It is really difficult to do this task manually, so an excel VBA macro could prove really helpful.
Sub ImportComments_Click()
Dim Fpath As String
Dim WordObj As Object
Dim wbkOutput As Excel.Workbook
Dim iRow As Integer
Dim i, j, k As Integer
Dim lRet As Long
Dim objAcroAVDoc As New Acrobat.acroAVDoc
Dim objAcroPDDoc As Acrobat.AcroPDDoc
Dim numPages As Long
Dim lAnnotscnt As Long
Dim Subtype As String
Dim NumComments As Long
Dim AcroApp As Acrobat.AcroApp
Dim objAcroPDPage As Acrobat.AcroPDPage
Dim annot As Acrobat.AcroPDAnnot
Sheets("Defect Log").Select
Range("L3").Activate
Fpath = ActiveCell.Value
Sheets("Defect Log").Select
Range("A1").Activate
i = 0
Do While (Not (IsEmpty(ActiveCell.Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 1).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 2).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 3).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 4).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 5).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 6).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 7).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 8).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 9).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 10).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 11).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 12).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 13).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 14).Value)))
i = i + 1
ActiveCell.Offset(1, 0).Select
Loop
iRow = i + 1
Set wbkOutput = ActiveWorkbook
lRet = objAcroAVDoc.Open(Fpath, "")
Set objAcroPDDoc = objAcroAVDoc.GetPDDoc
numPages = objAcroPDDoc.GetNumPages()
Set objAcroPDPage = objAcroPDDoc.AcquirePage(0)
For k = 1 To numPages
lAnnotscnt = objAcroPDPage.GetNumAnnots()
For m = 0 To lAnnotscnt - 1
If lAnnotscnt = 0 Then Exit For
Set objAcroPDAnnot = objAcroPDPage.GetAnnot(m)
If (objAcroPDAnnot.GetContents <> "" And objAcroPDAnnot.GetSubtype = "Text") Then
Cells(iRow, 5).Value = k
Cells(iRow, 2).Value = objAcroPDAnnot.GetContents()
Cells(iRow, 11).Value = objAcroPDAnnot.GetTitle()
iRow = iRow + 1
End If
Next m
Set objAcroPDPage = objAcroPDDoc.AcquirePage(k)
Next k
lRet = objAcroAVDoc.Close(1)
Set objAcroAVDoc = Nothing
Set objAcroPDAnnot = Nothing
Set objAcroPDPage = Nothing
Set objAcroPDDoc = Nothing
End SubMake sure you are current with 9.x patches, just on general principles.
The code seems fine – nothing jumping out at me.
You can also look at using the JSObject methods and trying this via the JavaScript stuff – that will give you more access to the Annotation information…
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Thu, 24 Nov 2011 04:25:12 -0800
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: Problem with controlling Annotations from Excel VBA
Problem with controlling Annotations from Excel VBA
created by apreeti<http://forums.adobe.com/people/apreeti> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4044740#4044740 -
Hello,
I have Windows 8, 64bit and Office 2010
I am trying to get the 'datepicker' (MonthView) ActiveX control toolbox in Excel 2010 as part of a Excel UserForm I have created. I have spent all day trying to find a solution for my problem.
I opened up the 'more.. ' but the MonthView/datepicker/calendar control is not listed.
I referred to some articles and confirmed that I do indeed have the mscomct2.ocx file in the C:\Windows\syswow64 folder.
I followed the instructions as above, opening up the Administrator Command Prompt and changed the directory to C:\Windows\syswow64 and typed in RegSvr32.
I received a popup screen confirming my registration was successful
Excel was closed. So I opened Excel and checked out the ActiveX Tool box and clicked on the 'More Controls', but there was no listing for the Microsoft MonthView control, (nor datepicker/calendar)
I then downloaded the latest Windows Common Controls 2 6.0 from the following site
http://support.microsoft.com/kb/297381
Copied the original file (2008) and saved it elsewhere on the computer for safekeeping.
Extracted the new mscomct2.ocx.
Under the C:\Windows\syswow64 I changed the original file properties to allow me to overwrite it with the new file. This worked … old file replaced.
I then registered the new file via the Administrator Command Prompt (as above) and was notified that it was successful. I rebooted pc and went back into Excel to find the MonthView in the
ActiveX toolbox, More Controls… and it still wasn’t there …
I would be very grateful if someone could advise how I can get this control and allow me to use it.
If I have left out any information that you need to resolve this issue, please advise.
Cheers,
TheShyButterfly
Hope you have a terrific day, theShyButterflyHi George,
Thank you for checking this out ... :)
I am using Office 2010 64 bit ...
I found the
mscomct2.ocx file originally within the C:\Windows\syswow64 directory (this was an original file .... which I expect was installed via Microsoft at the time of the Office installation.
As I mentioned above, I followed
the instructions (same as the ones you suggested), but still no go, even though it stated that the registration was successful ! :(
Why weren't these features included in the 64 bit ? ... yes, I read the article ... but ... so MS doesn't think that people/developers would be needing this in due course? I installed the 64bit version because I'm running the Win8 64bit version ...and
I deal with a lot of large spreadsheets and can't afford to sleep whilst they decide to load.
If MS included all the other ActiveX controls and some obscure ones, surely some bright spark could have thought that something as useful as MonthView should be included as 'basic' necessity when dealing with forms and sheets?
Perhaps you could pass the suggestion up the line .... there are a lot of other people out there having the same problem ... I found heaps when I was looking for a solution.
Sorry, I'm not having a go at you, but just incredibly frustrated .... the amount of lost productivity directly cause by trying to find a solution that doesn't exist ... it's been at least a good solid 24 hours.
But thank you for taking the time to review my post and your suggestion. It's unfortunate that because you are part of the organisation ... you tend to cop some slack from frustrated people like myself.
In relation to the pictures/screen dumps, 2 of them made it (I can see them in my post) ... one I deliberately left out because there was nothing on there that showed anything other than the rest of the 'More Controls' - nothing to do with the MonthView.
Please feel free to escalate this to the powers that be ... and hopefully enough people will join the voice so a change can be made (I can dream ... can't I?)
I've taken a screen dump of the Forms/ActiveX toolbox.
I don't know what the next step is ... I guess you'd be able to advise.
Cheers,
TheShyButterfly
Hope you have a terrific day, theShyButterfly -
Need help with VBA to control PDF fields
Hi,
I am attempting to use Excel VBA to control Acrobat but cannot find any documentation on the syntax to modify fields within the PDF form.
I am able to commnicate with Acrobat using CreateObject ( "AcroExch.App") and point to the AVDocs, PDDocs, PDPage objects.
However, I cannot find any methods that would allow me to change fields on the PDF.
I am attempting something very similar to a mail merge where I
Open a template PDF document
Populate the LastName, First Name fields
Then lock (make fields ReadOnly) the above so the User cannot modify them
Then save the PDF with the prefixed Lastname & First Name.
The template PDF form is created in LiveCycle Designer & is a fillable PDF. It can be filled in Adobe Reader.
Am using Office 2007 Excel with the corresponding VBA - The VB code has a Reference to Adobe Acrobat 9.0 Type library.
ThanksFor an XFA document, try using the JSObject (http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/IAC_DevApp_OLE_Support.100.1 3.html) to control the form. I haven't tried this, but I think it's your best chance for the second and third things you list.
-
Compatibility problem with macro media flash active control
I am getting a message on my screen "compatibility problem with macro media flash active control, it isnt compatible with my version of windows (vista). How can this be fixed? why am I suddenly getting it now? I have the latest Adobe flash player installed.
Trishathe latest flash is probably the problem... it's seems that the latest flash has been causing a boat load of issues. i did a system restore to undo the flash and mozilla upgrades and it's still crashing but not as bad as it was with the upgrades.
-
I have had my MacBook Pro i7 for about 2 months now. I noticed that sometimes lately (about 3 times in the past month) when I use the Control Zoom feature to zoom in the screen there are some ridiculous artifacts that appear. The screen will literally shift or off center to the left of the screen (about 4 inches) and the now empty right side will be filled with weird purple artifacts on screen. This only locks up and happens for about 2 seconds and then its back to normal.
Has anyone else experienced this issue?Thanks for the information about USB Overdrive. I hadn't heard of that one but will check it out.
I will include what I know from the manufacturer's websites in case anyone else is having similar problems. Kensington claims that Mouse Works, their driver software is fully supported in SL but, they have stopped development for it and they did not provide an answer to my question as to whether they were working on new driver software. I will say that all the functionality of Mouse Works is intact with the one exception of scroll-zooming.
Wacom informed me that they are aware of this problem and currently are working on a solution but did not provide a time frame as to when they may be releasing an update or a new software piece. So it would seem that while Wacom is concerned and working to resolve the issue, Kensington has chosen to abandon its customers which is a shame considering the quality and workmanship of their products.
For anyone following this thread I will keep it updated as I learn new information but as it stands now, it seems that scroll-zooming with Kensington's Expert Mouse trackball is vapor and won't return. I'm pinning my hopes on Wacom and while this would still be cumbersome it will be less so than having a fourth input device on my desk (trackball, tablet, 3Dconnexion and Mighty Mouse being the fourth). -
Control +/- Zoom disabled Cs4??
Hello, I am having a frustrating problem. WHen I try to use
my control +/- zoom, it is not working. Is there something I could
have done to disable that? I checked my number lock. I also looked
at the keyboard shortcuts and under the zoom shortcut there is a
yellow triangle that shows up with a message that says "this
shirtcut is already assigned to the pin script command", which I
assume is normal. I do not know how to fix this and searched forums
as well. I appreciate the help!This is only occuring with the number pad.
-
I'm trying to take screenshots with control-zoom but everytime I try 'command-shift-3' it takes a picture of the whole desktop (zoomed out) or 'command-shift-4' it limits how small of a screen shot I can take. Basically I want to be able to zoom really close on whatever part of the screen then capture exactly what I'm seeing on the screen. I.E. zoom really close on someone's face and take a screen cap of it, pixels and all. Anyone get what I'm saying? Anyone know how I can do this?
Thank you.Thanks for the information about USB Overdrive. I hadn't heard of that one but will check it out.
I will include what I know from the manufacturer's websites in case anyone else is having similar problems. Kensington claims that Mouse Works, their driver software is fully supported in SL but, they have stopped development for it and they did not provide an answer to my question as to whether they were working on new driver software. I will say that all the functionality of Mouse Works is intact with the one exception of scroll-zooming.
Wacom informed me that they are aware of this problem and currently are working on a solution but did not provide a time frame as to when they may be releasing an update or a new software piece. So it would seem that while Wacom is concerned and working to resolve the issue, Kensington has chosen to abandon its customers which is a shame considering the quality and workmanship of their products.
For anyone following this thread I will keep it updated as I learn new information but as it stands now, it seems that scroll-zooming with Kensington's Expert Mouse trackball is vapor and won't return. I'm pinning my hopes on Wacom and while this would still be cumbersome it will be less so than having a fourth input device on my desk (trackball, tablet, 3Dconnexion and Mighty Mouse being the fourth). -
Error 97 when opening existing Excel workbook
I have a LabVIEW application that reads environmental data from two transmitters and writes the data to two sheets of an Excel workbook (this is done using ActiveX). I have run the application successfully on my computer and a laptop, both of which are running Windows XP and Office 2003. After installing the application on the computer that we want to use for the actual test, however, a problem was observed. If we attempt to open an existing Excel file (which is what we need to do), LabVIEW generates an error 97 message (null reference) and the program does not run. This computer is running Excel 2000. I checked the registry settings for Excel per a similar discussion and found no problems. Opening a new Excel file works fine. Thanks.
Hello,
A few things come to mind:
1. I wonder if the excel version matters here. Could it be that you have a different version of the activeX control on your target machine?
2. Posting a minimal, simplified version of your code may help as well... so we can see precisely where the error occurs. Maybe just the open operation and if relevant the ActiveX property node from which you are receiving the error - identifying precisely where the error originates will be helpful.
3. Here is another thread addressing the same error that may be helpful to you:
http://forums.ni.com/ni/board/message?board.id=170&message.id=172065
Give it a thorough read just to make sure you're not having a similar issue - if you are, you just may have the solution!
I hope this helps!
JLS
Best,
JLS
Sixclear -
We are using SharePoint 2010 and Excel 2010. In SharePoint, we have created a custom content type that uses an Excel workbook template along with a Document Information Panel (DIP -- an InfoPath form) that always displays when a workbook of this custom
content type is opened. That's all working fine. However, if one of those Workbooks is open with the DIP displayed and the user opens another Excel workbook, a DIP displays for the 2nd workbook even if it's just a regular workbook,
i.e. not one of the custom content type. If the user closes one of the DIPs, both close. And if the user displays one of the DIPs again, both display.
Is there any way to separate out the DIP display for specific workbooks during the same Excel instance so that it shows in one but not in the other? Or is this just something we have to live with (and train our users on)?
Thanks in advance. Carol.Whether the DIP shows or not is a client side toggle, not something tied to an individual workbook. So if you are using the same client instance then the DIP will display or hide based on what you did in the other workbook. YOu might be able
to create a macro that would display or hide it, but that's a lot of work for little advantage. I would train the users and live with it.
Paul Stork SharePoint Server MVP
Principal Architect: Blue Chip Consulting Group
Blog: http://dontpapanic.com/blog
Twitter: Follow @pstork
Please remember to mark your question as "answered" if this solves your problem. -
Converting mutiple excel workbooks
I use Acrobat 8 standard edition.
We successfully convert an existing single excel workbook
with 18 TABS into a single PDF document. One of these TABS has
hyperlinks to other TABS in the same workbook. When we convert to
PDF the links work as expected and we can jump around the PDF using
them.
We now want to convert a series of multi-tab workbooks into a
single PDF document. OK we could combine several PDF's onto one I
know, but the snag is that the first excel workbook is to contain
hyperlinks to TABS in one or more of the other workbooks, so that
when we convert to PDF these links should jump to various parts of
the final PDF.
Any ideas.Check that you are not using VBA to protect the workbook on Open. This takes much longer in Excel 2013.
It would be code similar to this:
Sub protectSheets()
Dim i As Long
For i = 1 To Sheets.Count
Sheets(i).Protect Password:="password", userinterfaceonly:=True
Next i
End Sub
Check out this Link here:
http://office.microsoft.com/en-ca/access-help/office-2013-known-issues-HA102919019.aspx
Excel
Protecting sheets takes longer
Protecting sheets takes much longer than in previous Excel versions. It’s not noticeable when you’re manually protecting a sheet, but if you have code that protects or unprotects sheets repeatedly, it can become a performance issue.
The delay is caused by increased security in Excel 2013 for password protected files, because it uses a stronger hashing algorithm (SHA-512). In Office 2010 the default hashing algorithm for password protected files is SHA1. This change makes Excel password
protected workbooks more secure than they were in previous versions, but can cause a performance issue for some Office Developers.
Workaround This is by design so there is no workaround.
Andy Houghton -
Comment obtenir Excel Workbook Properties​.vi
Bonjour ,
dans l'aide LabVIEW, j'ai trouvé le VI : Excel Workbook Properties.vi qui m'intéresse.
quand je clique sur :
Place on the block diagram
ou sur
Find on the Functions palette,
mon explorateur tente de se connecter à une adresse qui plante.
Comment obtenir ces VI qui sont proposés dans l'aide ?
Merci d'avance.
Cordialement
TiboMéca.Hello,
I didn't understand the question... But the vi that have mentionet set's excel document properties using macros. So, you can do the same. Just search on google for macros for getting properties and do the same has the "Excel Workbook Properties.vi".
I don't have any version of office installed. So I can't help more.
http://www.cpearson.com/Excel/docprop.htm
Software developer
www.mcm-electronics.com
PS: Don't forget to rate a good anwser ; )
Currently using Labview 2011
PORTUGAL -
Collaborate on Excel workbooks with Sharepoint Foundation
My company recently implemented SharePoint Foundation 2013 and our shared Excel workbooks are no longer allowing multiple users to collaborate at the same time. We have verified that all the settings and permissions are correct and that checking in and
checking out is not required. Is this something that is not available with SharePoint Foundation? We are using Office 2013 installed on the clients, not Office online. Thank you.Co-authoring of Excel workbooks is only supported when all the editors are using the Excel web application, not the Excel client application.
From
Microsoft's overview of co-authoring in SharePoint 2013:
>"Co-authoring is easy to use from the end user’s point of view. When a user wants to work on a document in Word 2013, PowerPoint 2013, OneNote 2013, Visio 2013 or one of the Office Web Apps, he or she merely opens it from SharePoint 2013 or SharePoint
Online, as usual. If another user already has the document open, both users can edit the document at the same time.
One exception to this is that users can co-author in Excel Web App only if everyone uses the Excel Web App to access the workbook. If anyone uses Excel 2013 or Excel 2010 (the client application)
to access the workbook, co-authoring in Excel Web App will be disabled for that workbook while it is open in the client application."
>"The Excel 2013 client application does not support co-authoring workbooks in SharePoint 2013 or SharePoint Online. But, the Excel client application uses the Shared Workbook feature to support non-real-time co-authoring workbooks that are stored
locally or on network (UNC) paths." -
Excel Workbook with Excel Data Model stored on SharePoint - daily refresh
I'm not sure if this is exactly the right forum but I'm hoping that someone here can either answer or point me in the right direction.
I have an Excel Workbook with an Excel Data Model.
The Excel Data Model uses SQL to contact our data warehouse and pull through data into tables.
We are storing the Workbook on a SharePoint site and viewing it using Excel Services.
The data in our data warehouse is updated daily and so I would like to refresh the workbook daily and remove the option to refresh the data in the browser.
Is this possible with a workbook that has an Excel Data Model (I've seen lots of posts that relate to workbooks with connections to tabular models).
Thanks
PaulHi Paul,
I have answered this issue in this thread that you posted in SQL Server PowerPivot for SharePoint forum, please see:
http://social.msdn.microsoft.com/Forums/en-US/9627939c-e9f1-48ae-a6ed-0c238d8f2d69/excel-workbook-with-excel-data-model-stored-on-sharepoint-daily-refresh?forum=sqlkjpowerpointforsharepoint
Furthermore, this issue is more related to PowerPivot for SharePoint. If you have any more questions about PowerPivot for SharePoint, I would sugget you open a new thread in the forum below for better support:
http://social.msdn.microsoft.com/Forums/en-US/home?forum=sqlkjpowerpointforsharepoint
Thanks for your understanding.
Regards,
Elvis Long
TechNet Community Support -
Adding excel workbooks with visual studio
Im using visual studio 2013 visual basic to read and create files, but Im having trouble importing the correct reference so I can create and write to Excel workbooks and worksheets, the visual studio help tell me to go to project, add reference and select
Microsoft.Office.Interop.Excel, but it does not show on my list, what can I do, can anyone help, ThanksPlease view this link.
https://siddharthrout.wordpress.com/vb-net-and-excel/
Scroll down the page just a bit and you'll find your answer.
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.
Maybe you are looking for
-
Creating a new iTunes Radio station? iPhone 4S?
Every time I try to create a new iTunes Radio station it tells me "Unable to Create Station. There was a problem creating this station. Try again later." I've tried several different times with several different genres. I was wondering is it because
-
We have downloaded the movie and it shows the full time in the status at the top. It shows that we are at the begining, but when we hit play it says "Accessing the iTunes Store" the candy stripes run a little, then we are right back where we started
-
Connecting to Xbox Live using Ethernet and Airport
Is it possible to connect the xbox 360 using a ethernet cable to my powerbook g4, in order to utilise its wirelessly connected internet? and what do i have to enable etc to do so
-
How do I download Photo's??
I just bought an Ipod Nano for my daughter. In the little 4 page quickstart manual that came with it there is not a word about downloading photo's. This device is supposed to hold pictures but I don't know where to begin in order to download photo's.
-
Uploading data from an Excel to a temporal table
Hey everyone, I have found the information about ODI really interesting and I would like to confirm something. I am trying to upload some info from an excel file to ODI, and after that to make ODI check if there is any update on that file and upload