Out Of Memory when passing values to MS WORD file form field in VB.NET - vb.net

I have an old program that generates a Word file by passing variables to Word Form Fields
oWord.FormFields.Item("Marketing").Result() = " Something "
A few days ago something happened that whenever I pass any value, I receive the following error message: Out of memory
Has anyone encountered this issue recently? Could this have been caused by any Windows update? Is there any way to workaround the recently encountered issue.
I tried repairing MS OFFICE. Also reinstalling MS OFFICE, both failed. I'm using Visual Studio 2017 on Windows 10.

Related

E_ACCESSDENIED "General Access denied error" /CreateObject("Vbscript") blocked under office 365 VBA environment [duplicate]

This question already has answers here:
MS Access VBA Error: Run time error '70' Permission Denied
(3 answers)
Closed 1 year ago.
I have recently encountered an issue running code within Access 2016 and for office 365. Our COM component that we authored stopped working with the newer versions of office. I was able to attach the debugger and confirmed that trying to create an instance of VBScript INSIDE of VBA (our COM object uses Vbscript internally to execute code on our projects called via Access VBA ) returns E_ACCESSDENIED when CoCreateInstance is called inside of our COM object. Previous versions of Office as late as 2013 this worked just fine.
Also if you just run:
Dim tst As Object
Set tst = CreateObject("VBScript")
If Not (tst Is Nothing) Then
MsgBox "good"
Else
MsgBox "Bad"
End IF
In Excel or Access VBA on anything greater than 2013 I get:
"Run-time error '70': Permission denied" on the CreateObject("VBScript") line
VBScript CreateObject error message
This code executed just fine for me under office 2013 as well.
I have tried the following:
Setting ActiveX settings to enable all ( Under "Tust Center" )
Enable all Macros ( Under "Tust Center" )
Disabled "sandbox" at all times using the instructions listed here:
https://support.microsoft.com/en-us/office/turn-sandbox-mode-on-or-off-to-disable-macros-8cc7bad8-38c2-4a7a-a604-43e9a7bbc4fb
Does anyone know if there is a setting of some sort I can change in office to allow a vbscript instance to be instantiated from within office 365 VBA environment?
I have searched for a similar issue on the web and so far have found nothing useful.
So Thanks to sous2817 I was able to find actually what it was that I needed. While it may not be the most secure approach in all cases it should work for me.
I also found these 2 links that I used once I was pointed in the right direction:
https://support.microsoft.com/en-us/topic/security-settings-for-com-objects-in-office-b08a031c-0ab8-3796-b8ec-a89f9dbb443d
https://learn.microsoft.com/en-us/office365/troubleshoot/updates/control-block-ole-com
Basically I had to make an exception to prevent MS Office from blocking VBScript.

MS Access 2007 report export does not work after installing AccessDeveloperExtensions.exe and AccessRuntime.exe

In order to create an indipendent runtime file.accdr out of a file.accdb, I've downloaded AccessDeveloperExtensions.exe and AccessRuntime.exe and installed them.
Update:
See article Here is the Google Translater .
Update end.
Opening Access 2007 I could create the install package for creating the file.accdr out of the file.accdb.
The problem I get is that an important function does not work anymore. It's the export of a report, wherelse the export of a table still works.
Opening Access I get the following message:
you don't have a source code control program (such as Microsoft Visual Source Safe) installed on
your machine. The source code control commands are therefore not available
I click on OK and Access opens my db.
My db is based on a table, a form, a report and a query. Exporting the report worked in the past, but doesn't work anymore. The message shown is the following:
Impossible to complete output operation. Assure that there are no syntax errors. If the syntax is
correct, reinstall Microsoft Office Accept...
(I've translated the text from Italian).
Now is there another, easier way from reinstalling the hole thing? Because after reinstalling Access I will also have the need of creating databases.accdr and so I have reinstall runtime.exe and DeveloperExtensions again, what would result in the same problems I had before.
Somebody could help?

Access 2010 report ignores filter placed on it

I have run into an error with an Access Database created in MS-Access 2003. It's known the Calendar Control was deprecated in Access 2010 but unfortunately we need to keep using it. As a temp fix (until we can change to the date picker) we restored the MSCAL.OCX file on all 2010 users.
The issue:
We have a form to print schedules from a date range (using the calendar control). There is some VBA code to check to dates etc to make sure the range is accurate etc.
Everything works fine in 2003 but in 2010 the dates get selected fine on the form, is passed to the report (a print preview) fine as it displays in the footer BUT the query ignores the date range and prints ALL records (not just the records in the date range).
Is there any way I can step into Print Preview button when clicked to see what's being passed?
Any other ideas?
The issue with the filter not being applied to the report is a known Microsoft issue with certain set ups of Windows 7 and Access 2010. The hotfix found here: http://support.microsoft.com/kb/2596496 solved my problem.
I run Windows 7 64 bit and Office 2010 32 bit, when downloading the hotfix I selected the "x86" platform as that's the 32 bit. If you are using Office 2010 64 bit you should download the "x64" platform.
To find out your office version, open any office product, click File Tab, click Help and it will be on the right under "About Microsoft ".
The only way you can really do that is if your report/query is running some VBA code and put a Stop on the the VBA.
If your query is referencing the fields directly (IMNSHO a bad practice, but I'll work with what we've got) you could change them so they instead reference a VBA function that returns the results of those fields instead. Then you know what it is getting for sure.
There is one more trick that surely worked out for me as a solution, before I came across the accepted answer about hotfix on this thread. Also, because, the hotfix link leads to a valid thread, but there are not downloadable files.
The workaround:
Make a copy of the report file. Use that name in VBA under DoCmd call. Strange how it works, though. Such is the nature of bugs, I guess.

TF249051: No URL can be found that corresponds to the following server name

So am trying to open work items in Excel on my machine (TFS 2010 and Excel 2007) and I received original error from Excel
TF80070: Team Foundation encountered an error while performing the operation.
I found instructions on how to turn on diagnostics to find the underlying cause which is the error in the title
TF249051: No URL can be found that corresponds to the following server name
I cannot find anywhere in Excel that I can tweak the settings. How can I resolve this issue?
So the solution I found (after disabling and re-enabling the addin inside Excel and also removing the addin from inside Excel and re-adding it) was to go to the Team menu in Excel and click New List. It prompted me to connect to my collection which I did and then opened up a query (My Tasks). I guess somehow it didn't know exactly what to connect to although the complete error message I got from the diagnostic trace included the correct tfs server name and default collection name.

Crystal Reports & VBScript - Could Not Locate Automation Class

First off, I have very little Crystal Reports experience, so apologies in advance if this is a stupid question. I had this "fantastic" work project dumped on me when a co-worker left, so I'm hoping someone can help as most of the Business Objects links I find that might have solutions just redirect to a generic SAP splash page.
So I have a few hundred Crystal Reports (mostly File Schema 10.2, although some are 8.5 or 12.0) that are stored on a server. All of them have an associated VBScript file that calls them in the following way:
Set AppCrystal = WScript.CreateObject("CrystalRuntime.Application.10")
Set CrystalReport = AppCrystal.OpenReport("<file path to report>")
Set CrystalOptions = CrystalReport.exportOptions
CrystalOptions.DestinationType = 1
CrystalOptions.FormatType = 36
CrystalOptions.DiskFileName = "<file path to output excel file>"
CrystalReport.Export False
According to BO, this should be correct. See the following links about the CR API:
http://devlibrary.businessobjects.com/businessobjectsxi/en/en/RDC_SDK/rdc_com_dg_doc/doc/rdcsdk_com_doc/RDC_ObjectModel62.html
http://devlibrary.businessobjects.com/businessobjectsxi/en/en/RDC_SDK/rdc_com_dg_doc/doc/rdcsdk_com_doc/RDC_ObjectModel151.html#1387900
http://devlibrary.businessobjects.com/businessobjectsxi/en/en/RDC_SDK/rdc_com_dg_doc/doc/rdcsdk_com_doc/RDC_ObjectModel8.html#1646326
So basically the script just executes the report and outputs it to an Excel file. This works great on the old server, but when I try to execute this script on the new server I get the following error:
I assume this is because there's some kind of runtime components I need to install, but I can't for the life of me figure out what. I found this page: https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=56787567
But none of the files I've tried to download have worked, and, frankly, I've found SAPs documentation to be sub-par in this area. I do have Crystal Reports 2008 available, so if I need to update the vbscript to use CrystalRuntime.Application.12 or something and then install the newest runtime files for Crystal Reports 2008 on the server, that'd be fine. But I still need to know what runtime files to use? Nothing I can find has worked. Help?
Apparently this type of call to a Crystal report uses the RDC Report Engine, unfortunately CR 10 is no longer available. You can still get CR XI R2 which still deployed the RDC and it's version 11.5.
There is no RDC in CR 2008, it was actually deprecated in CR 9 and now no longer shipped.
Only other option you have is to convert your app to use Visual Studio .NET and use one of the current CR 2008 or CR for VS 2010 components and rewrite your app to .NET Framework.
No more VB Scripting supported, but that was just the Dev Language...
I ended up just upgrading to CR 2008, and using .NET console projects to replace the VB scripts.