-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmicrosoft_backup.html
520 lines (491 loc) · 14.6 KB
/
microsoft_backup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Microsoft</title>
<style>body{font-size: 12px}code,pre{margin:0;padding:0;}
body>pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space: -o-pre-wrap;word-wrap:break-word;}
</style>
</head>
<body>
<h1>VB.NET, VBA, VBScript, C#, VB , C++, F#</h1>
<table border="1">
<tbody>
<tr>
<th>Member function</th>
<th>typical form for class <code>C</code>:</th>
</tr>
<tr>
<td><a href="#default_constructor">Default constructor</a></td>
<td><code>C::C();</code></td>
</tr>
<tr>
<td><a href="#destructor">Destructor</a></td>
<td><code>C::~C();</code></td>
</tr>
<tr>
<td><a href="#copy_constructor">Copy constructor</a></td>
<td><code>C::C (const C&);</code></td>
</tr>
<tr>
<td><a href="#copy_assignment">Copy assignment</a></td>
<td><code>C& operator= (const C&);</code></td>
</tr>
<tr>
<td><a href="#move">Move constructor</a></td>
<td><code>C::C (C&&);</code></td>
</tr>
<tr>
<td><a href="#move">Move assignment</a></td>
<td><code>C& operator= (C&&);</code></td>
</tr>
</tbody>
</table>
<pre>The error occurs because of the As Object clause. Unlike VBA, VBScript has only one data type — Variant, so you don't specify the data type when declaring a variable. Remove the As Object clauses and the script should work fine:
<meta http-equiv="x-ua-compatible" content="IE=10">
<script type="text/vbscript">
msgbox "Vbscript"
</script>
<a href="./$.xlsm">$.xlsm</a>
Excel is stupid
- you can't put multiple links in the same cell
- you can't put images(only links) in a cell, although you can attach it as a comments background
- it is only scriptable with
- VBA, VB.NET
- Mathematica
- http://xlwings.org/
- https://datanitro.com/pricing
Sites
https://tduhameau.wordpress.com
http://excelmatters.com
http://www.automateexcel.com/functions
http://www.cpearson.com/Excel/ListFirstAndLastElements.aspx
http://businessfunctions.com/index.php?pageno=156
- PMT - http://www.techonthenet.com/excel/formulas/pmt.php
FV
<a href="https://blogs.harvard.edu/rprasad/2014/06/16/reading-excel-with-python-xlrd/">Reading Excel with Python</a>
python-excel.org
Excel Solver
Google Docs JS | Microsoft Office VisualBasic | Microsoft Office Online
Dim 'stands for Dimensions
f2 - Object Browser
.Cells(0,0) ' -1 -1 cell
Named Ranges Excel allows for stuff like Sum(Students)
https://msdn.microsoft.com/en-us/library/22x2chfx.aspx VB.NET Only
Access macro actions represent only a subset of the commands available in VBA.
Alt+F11, Alt+I, M
Insert>Module | Accesses macros and code
Redim Preserve
Stored array | A1:A2
Array constant | INDEX({1,2,3},1)
VBA array | Dim a: a = Array("1", "2", "3"): a(0)
Dim Arr() As Variant
Arr = Range("A1:B10")
Dim R As Long
Dim C As Long
For R = 1 To UBound(Arr, 1) ' First array dimension is rows.
For C = 1 To UBound(Arr, 2) ' Second array dimension is columns.
Debug.Print Arr(R, C)
Next C
Next R
VBA: Visual Basic for Applications Different Versions
VSTO: Visual Studio Tools for Office
VSTA: Visual Studio Tools for Applications
VS.NET: Visual Studio.NET – currently version 2003. 2005 due next month.
IDE: Integrated Development Environment (in Excel, this is the visual basic editor)
F# Hello World</pre>
<pre data-lang-guess="C#" id="pre549525">open System
[<EntryPoint>]
let main argv =
printfn "Hello World"
Console.ReadLine() |> ignore
0 </pre>
<pre>
</pre>
<pre>
Mathematica Python/ASP.NET Excel VB</pre>
<table style="width:100%" border="1"><tbody>
<tr>
<td width="33%">C#</td>
<td width="33%">Mathematica NETLink
<br>
Needs["NETLink`"];<br>
InstallNET[];</td>
<td width="33%">Symbolic Mathematica</td>
</tr>
<tr>
<td>MyClass o = new My Class(args);</td>
<td>o = NETNew["MyClass",args];</td>
<td>o= new["MyClass",args]</td>
</tr>
<tr>
<td>o.method(args);</td>
<td>o@MethodName[args];</td>
<td>o=;</td>
</tr>
<tr>
<td>o.prop = 1; val = obj.prop;</td>
<td>o@prop = 1; val = o@prop;</td>
<td></td>
</tr>
<tr>
<td>MyClass.StaticMethod(args);</td>
<td>MyClass`StaticMethod[args];</td>
<td></td>
</tr>
<tr>
<td>MyClass.StaticPropertyOrField = 1;<br>
value = MyClass.StaticPropertyOrField;</td>
<td>MyClass`StaticPropertyOrField = 1;<br>
value = MyClass`StaticPropertyOrField;</td>
<td></td>
</tr>
<tr>
<td>int i = 23;</td>
<td>i = 23;</td>
<td>i = int[23];</td>
</tr>
<tr>
<td></td>
<td></td>
<td>public[x_] := (<br>
Print[23];<br>
Hold@x<br>
);<br>
SetAttributes[public, HoldAll]<br>
using@System;<br>
public@class@Hello[<br>
public@static@void@Main[][<br>
i = int[23];<br>
j = int[23];<br>
k = object[0];<br>
s = string["hello" + " world"];<br>
true;<br>
Console@WriteLine["Hello World"];<br>
System@Math@Pow[2.0, 32.0];<br>
];<br>
]</td>
</tr>
</tbody>
</table>
<pre>
Me vs this
<code>Friend vs internal - access modifiers allowing inter-class but not intra-assembly reference
MustInherit vs abstract - prevents a class from being directly instantiated, and forces consumers to create object references to only derived classes
MustOverride vs abstract - for forcing derived classes to override this method
MyBase vs base - for referring to the base class from which the current class is derived
NotInheritable vs sealed - for declaring classes that may not be inherited
NotOverridable vs sealed - for declaring methods that may not be overridden by derived classes
Overridable vs virtual - declares a method as being able to be overridden in derived classes
Shared vs static - for declaring methods that do not require an explicit instance of an object</code></pre>
<table border="1" >
<tbody>
<tr>
<td width="25%">
<pre><code>Visual Basic.NET (.vbproj & .vb)
vbc.exe /t:exe /debug+ /optionstrict+ /out:.\HelloVB.exe HelloVB.vb
</code></pre>
</td>
<td width="25%">
<pre><code>VBA/VB6(.vb)
test</code></pre>
</td>
<td width="25%">
<pre><code>VBScript(.vbs or .vbe)
crscript wscript</code></pre>
</td>
<td width="25%">
<pre><code>C#(.cs)</code></pre>
</td>
<td width="25%">C++</td>
</tr>
<tr>
<td width="25%"></td>
<td width="25%">
<pre><code>Private Sub Form_Load()
Dim x As String ' type optional
x = "Hello World"
MsgBox x
End Sub
Form_Load()
Format(#1/27/1993#, "yyyy-MM-dd Hh:mm:Ss")
</code></pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code>namespace Add_Function{
class Program{
static void Main(string[] args){
int a;
int b;
int c;
Console.WriteLine("Enter value of 'a':");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter value of 'b':");
b = Convert.ToInt32(Console.ReadLine());
//why can't I not use it this way?
c = Add(a, b);
Console.WriteLine("a + b = {0}", c);
}
}
}</code></pre>
</td>
<td width="25%">#include <iostream><br>
#include <string><br>
using namespace std;<br>
class Example4 {<br>
string* ptr;<br>
public:<br>
Example4() : ptr(new string) {}<br>
Example4 (const string& str) : ptr(new string(str)) {}<br>
// destructor:<br>
~Example4 () {delete ptr;}<br>
const string& content() const {return *ptr;}<br>
};<br>
int main () {<br>
Example4 foo;<br>
Example4 bar ("Example");<br>
cout << "bar's content: " << bar.content() << '\n';<br>
return 0;<br>
}</td>
</tr>
<tr>
<td width="25%">
<pre>'Boolean, Byte, Char, Date, Decimal, Double, Integer, Long, Object,
SByte, Short, Single, String, UInteger, ULong, User-Defined(inherit
ValueType), UShort
</pre>
</td>
<td width="25%">
<pre>'Byte,Integer,Long,Single,Double,Currency,Decimal,
'String(n),Date,Boolean,Object,Variant
'requires you to define variable if explicit
<code>Option Explicit On
Dim a, b, c, d, m, n As Integer
Const MyInteger As Integer = 42
Dim x, y As Double
Dim, Set, RefBy, ByVal</code></pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code>//bool, byte, chair, decimal, double, float, int, long, sbyte, short, uint, ulong, ushort
int a,b,c,d,m;
double x,y;</code></pre>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%"></td>
<td width="25%">
<pre><code>result = IIf(5 < 10, "Yes it is", "No it isn't</code></pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code>result = (5 < 10) ? "Yes it is" : "No it isn't"</code></pre>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%"></td>
<td width="25%">
<pre><code>Dim count As Integer = 0
Dim message As String
If count = 0 Then
message = "There are no items."
ElseIf count = 1 Then
message = "There is 1 item."
Else
message = "There are " & count & " items."
End If)</code></pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code>r;;</code></pre>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%"></td>
<td width="25%">
<pre><code>And Or Xor Not <> = AndAlso OrElse object.ReferenceEquals(a, b)
!object.ReferenceEquals(a, b) typeof(a) a is b(type comparison)</code></pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code>& | Xor != == && Is IsNot GetType(Integer) TypeOf a Is b</code></pre>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%">
<pre><code>For i As Integer = 0 To number - 1
' loop from zero up to one less than number
Next
Exit For 'breaks out of a for loop
Exit While 'breaks out of a while loop
Exit Do 'breaks out of a do loop</code></pre>
</td>
<td width="25%">
<pre><code>For i = 0 To 2
MsgBox i
Next
Dim i: i = 0
While i <
MsgBox i
i = i + 1
Wend
fruits = Array("apple", "orange", "cherries")
Dim fruitnames As Variant
For Each Item In fruits
fruitnames = fruitnames & Item & Chr(10)
Next
MsgBox fruitnames
Public Sub OnErrorDemo()
On Error GoTo ErrorHandler 'Dim x, y, z As Integer
x = 50
y = 0
z = x / y ' Divide by ZERO Error Raises
ErrorHandler: ' Error-handling routine.
Select Case Err.Number ' Evaluate error number.
Case 10 ' Divide by zero error
MsgBox ("You attempted to divide by zero!")
Case Else
MsgBox "UNKNOWN ERROR - Error# " & Err.Number & " : " & Err.Description
End Select
Resume Next
End Sub</code></pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code>for (int i = 0; i < number; ++i)
// loop from zero up to one less than number
}
//break
//continue</code></pre>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%">
<pre><code>breakpoint</code></pre>
</td>
<td width="25%">
<pre><code>Stop</code></pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code> </code></pre>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%">
<pre><code>Dim t As New System.Threading.Thread(Sub()
For n as Integer = 0 to 10 'Count to 10
Console.WriteLine(n) 'Print each number
Next
End Sub)
t.Start()</code></pre>
</td>
<td width="25%">
<pre><code>N/A</code></pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code></code></pre>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%">
<pre><code>breakpoint</code></pre>
</td>
<td width="25%">
<pre><code>Function MyMax(ParamArray agrs())
End Function</code></pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code>private void method(params int[] arguments) {
//deal with args
}</code></pre>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%">
<pre>//Private can be used on
// Class,Const,Declare,Delegate,Dim,Enum,Event,Function,
Interface,Property,Structure,Sub
<code>Public Class Employee
End Class
</code></pre>
</td>
<td width="25%">
<pre><code>'Classes don't really have a syntax exactly
Private Sub Class_Initialize()
MsgBox "Init"
End Sub
Private Sub Class_Terminate()
MsgBox "Terminate"
End Sub
'cpearson.com/excel/classes.aspx
Type Employee
Name As String
Salary As Double
End Type
Dim i As Employee
i.Name = "Joe Smith"
i.Salary = 40000</code></pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code>public class Employee{
//Fields, properties, methods and events go here...
}
</code></pre>
</td>
<td width="25%"></td>
</tr>
<tr>
<td width="25%">
<pre>//Private can be used on
// Class,Const,Declare,Delegate,Dim,Enum,Event,Function,
Interface,Property,Structure,Sub
<code>Public Class Employee
End Class</code></pre>
<pre><code>
</code></pre>
</td>
<td width="25%">
<pre><code>Function Split1()
Dim strTest As String
Dim strArray() As String
Dim intCount As Integer
strTest = "Fred & Wilma & Barney & Betty"
strArray = Split(strTest, "&")
For intCount = LBound(strArray) To UBound(strArray)
MsgBox Trim(strArray(intCount))
Next
End Function
a = array("Red","Blue","Yellow")
b = join(a,"$")
</code></pre>
<pre>Sub OptionalArgs(i As String, Optional s As String = "init")
'MsgBox 1
End Sub<br>
</pre>
</td>
<td width="25%"></td>
<td width="25%">
<pre><code>string[] separators = {",", ".", "!", "?", ";", ":", " "};<br>
string value = "The handsome, energetic, young dog was playing with his smaller, more lethargic litter mate.";<br>
string[] words = value.Split(separators, StringSplitOptions.RemoveEmptyEntries);
</code></pre>
</td>
<td width="25%"></td>
</tr>
</tbody>
</table>
</body>
</html>